Expand description
Routing: which views show a notice.
egui-pop gives the mechanism, the application the policy. A policy
(NoticeRouting) is given each notice raised and answers a
Route: the Surfaces that show it (inline at its place, a
toast, the status bar’s badge, the history, the Decisions surface).
default_route is egui-pop’s own policy, the table below; an
application installs its own in its place.
| Notice | Surfaces |
|---|---|
| an ask (any origin) | Decisions, history |
| a condition (any origin) | inline at its place when a site shows it, history; badge when a warning or an error |
| a user’s error or warning | inline at its place when a site shows it, else a toast; history |
| a user’s information or success | toast, history |
| a background, node or system error or warning | badge, history (never a toast) |
| a background, node or system information or success | history |
use egui_pop_model::notice::Notice;
use egui_pop_model::notice::route::{RouteCx, Surface, default_route};
let cx = RouteCx::new(["settings/storage/nodes"]);
let failed = Notice::error("cloudy was not added").place("settings/storage/nodes");
assert_eq!(
default_route(&failed, &cx).surfaces,
[Surface::Inline("settings/storage/nodes".into()), Surface::History]
);Experimental: may change in any release
(docs/stability.md).
Structs§
- Default
Routing - egui-pop’s own policy:
default_route. - Route
- The surfaces a policy picked for one notice, in order.
- RouteCx
- What a policy knows besides the notice: the places a notice site shows now.
Enums§
- Surface
- A view that shows a notice.
Traits§
- Notice
Routing - An application’s routing policy. A closure
Fn(&Notice, &RouteCx) -> Routeis one.
Functions§
- default_
route - egui-pop’s default routing table (the module’s): background work never pops up, a user’s own failure shows where it happened.