1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! `frus` — the framework's **facade**: a **single dependency** (`frus`) is all an
//! application needs. It re-exports the framework layer (`frus-shell`) and the widgets
//! (`frus-widgets`), plus the **single entry point** [`main!`].
//!
//! ```ignore
//! use frus::{Application, Command, Widget, Theme, button, column};
//!
//! #[derive(Default)]
//! struct App { count: i32 }
//! # #[derive(Clone)] enum Msg { Inc }
//! impl Application for App {
//! type Message = Msg;
//! fn update(&mut self, _m: Msg) -> Command<Msg> { Command::none() }
//! fn view(&self, _t: &Theme) -> Box<dyn Widget<Msg>> { todo!() }
//! }
//!
//! // One entry point, for every platform.
//! frus::main!(App::default());
//! ```
//!
//! The thin desktop binary calls the generated `run()`: `fn main() -> frus::anyhow::Result<()>
//! { my_app::run() }`. On the web, the application keeps a `wasm-bindgen` dependency (targeted
//! at `wasm32`), which the generated `#[wasm_bindgen(start)]` entry point needs.
// The README's example is compiled by `cargo test --doc`, so it cannot rot.
;
// Widgets, theming, layout, and the DSL (`row!` / `column!`) — all of `frus-widgets`.
pub use *;
// Framework layer: the [`Application`] trait and its companions (effects, subscriptions,
// lifecycle).
pub use ;
// Utility re-exports for the thin binary and for the entry-point macro (so the application
// does not have to declare `anyhow` / `log` itself).
pub use anyhow;
/// **Messages for the developer**: `frus::log::info!`, `warn!`, `error!`, `debug!`.
///
/// They reach the console with nothing to set up: the terminal on desktop, logcat on Android
/// (tagged with the application's crate name), the browser's console on the web. From `info`
/// up by default, and from `debug` up for the application's own crate in a debug build. On
/// desktop, `RUST_LOG` decides over that default.
///
/// ```
/// frus::log::info!("signed in as {}", "ada");
/// frus::log::warn!("the cache is {}% full", 93);
/// ```
pub use log;
// Macros: a glob (`frus_widgets::*`) does **not** re-export `#[macro_export]` macros, so we
// name them explicitly — hence `frus::main!`, `frus::column!`, `frus::row!`.
pub use main;
pub use ;
/// Registering the application's own faces, and naming the families text resolves
/// to. An application that ships its own can drop the bundled ones through the
/// `bundled-*` features — see the "Shipping" section of the getting-started guide.
// The system's file dialogs (feature `file-dialogs`, desktop only): `FileDialog`.
pub use FileDialog;
// The system's notifications (feature `notifications`, desktop, Android and the Web):
// `SystemNotification`.
pub use ;
// Cross-platform HTTP (feature `net`): the `frus::fetch(url).await` shorthand and the
// `frus::Request` builder (method / headers / body / timeout) — see [`frus::net`].
pub use ;