Skip to content

Commit 74ff5c9

Browse files
committed
Add "Frequently Asked Questions" section
1 parent d124802 commit 74ff5c9

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@
2828

2929
# Appendix
3030
- [Additional Resources](additional-resources.md)
31+
- [Frequently Asked Questions](faq.md)

src/faq.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Frequently Asked Questions
2+
3+
## When Will the Book Be Finished?
4+
Soon™. Open source is a gift; so whenever I feel like it.
5+
6+
## How Do I Scale a Large Application?
7+
You split your application into multiple screens, and then use simple composition.
8+
9+
[The Pocket Guide] has [a specific section that showcases this approach](https://docs.rs/iced/0.13.1/iced/#scaling-applications).
10+
11+
## How Can My Application Receive Updates From a Channel?
12+
You can use [`Task::run`] to generate messages from an asynchronous [`Stream`].
13+
14+
Alternatively, if you control the creation of the channel; you can use [`Subscription::run`].
15+
16+
[The Pocket Guide]: https://docs.rs/iced/0.13.1/iced/index.html#the-pocket-guide
17+
[`Task::run`]: https://docs.rs/iced/0.13.1/iced/task/struct.Task.html#method.run
18+
[`Subscription::run`]: https://docs.rs/iced/0.13.1/iced/struct.Subscription.html#method.run
19+
[`Stream`]: https://docs.rs/futures/latest/futures/stream/trait.Stream.html
20+
21+
## Does Iced Support Right-To-Left Text and/or CJK scripts?
22+
Not very well yet!
23+
24+
You may be able to render some scripts using [`Text::shaping`] with [`Shaping::Advanced`],
25+
but text editing for these scripts is not yet supported; and neither are [Input Method Editors].
26+
27+
These features are in the [`ROADMAP`], however!
28+
29+
[`Text::shaping`]: https://docs.rs/iced/0.13.1/iced/widget/text/type.Text.html#method.shaping
30+
[`Shaping::Advanced`]: https://docs.rs/iced/0.13.1/iced/widget/text/enum.Shaping.html#variant.Advanced
31+
[Input Method Editors]: https://en.wikipedia.org/wiki/Input_method
32+
[`ROADMAP`]: https://whimsical.com/roadmap-iced-7vhq6R35Lp3TmYH4WeYwLM
33+
34+
## When Are the `view` and `subscription` Functions Called?
35+
After every batch of messages and `update` calls. But this is an implementation detail;
36+
and should never rely on this.
37+
38+
Try to treat these functions as declarative, stateless functions.
39+
40+
## Does Iced Redraw All the Time?!
41+
Yes! iced currently redraws after every runtime event; including tiny mouse movements.
42+
43+
There are plans to redraw less frequently by detecting widget state changes, but performance has not
44+
been a priority so far.
45+
46+
The renderers do perform quite a lot of caching; so redrawing is quite cheap. As a result,
47+
this is rarely an issue for most use cases!
48+
49+
## I Am Getting A Panic Saying There Is No Reactor Running. What Is Going On?
50+
You are probably using `Task` to execute a `Future` that needs the `tokio` executor:
51+
52+
```
53+
there is no reactor running, must be called from the context of a Tokio 1.x runtime
54+
```
55+
56+
You should be able to fix this issue by enabling [the `tokio` feature flag] in the `iced` crate:
57+
58+
```toml
59+
iced = { version = "0.13", features = ["tokio"] }
60+
```
61+
62+
[the `tokio` feature flag]: https://docs.rs/crate/iced/latest/features#tokio

0 commit comments

Comments
 (0)