Expand description
COSMIC application implementation for Avestruz.
This module wires up the [cosmic::Application] trait — defining the
init, update, view, and subscription lifecycle — and re-exports the
core types (AppModel, Message, ViewState) that the rest
of the crate depends on.
flowchart TD
init["init: the config is read, and four things start at once"] --> running
subgraph running["For as long as the session"]
direction LR
subscription["subscription: two timers, the config watch, pictures and previews asked for"]
update["update: one match over every Message, each arm a handler"]
button["the button in the panel: another process"]
window["view_window: the popup, when it is open"]
subscription -->|"messages"| update
window -->|"messages"| update
button -->|"TogglePopup"| subscription
update -->|"the model changed"| window
endWhat starts at init, and in which order the answers matter, is in
crate::guide::architecture.
Re-exports§
pub use crate::messages::Message;pub use crate::state::AppModel;pub use crate::state::BookmarkState;pub use crate::state::FeedState;pub use crate::state::LoginProgress;pub use crate::state::MediaState;pub use crate::state::RelaysState;pub use crate::state::ViewState;
Constants§
- APP_ID
- The name the panel, the settings and the keyring know Avestruz by.
- NEW_
NOTES_ 🔒EVERY_ CLOSED - NEW_
NOTES_ 🔒EVERY_ OPEN - How often the feed is looked at for new notes: while the popup is open, and while it is closed.
- SWEEP_
LOOK_ 🔒EVERY - How often it is seen whether the event store is to let go of what is old: it does so once a day, and the day may begin at any time.
- UPLOADS_
SHOWN_ 🔒EVERY - How often the composer says anew how far the files on their way to a media server have got.
Functions§
- from_
button 🔒 - What the button in the panel says, as messages.
- from_
outside 🔒 - What is said to the window from outside, as messages: a keyboard shortcut of the desktop’s toggles the popup as the button does.
- run
- Run the program as the window: the whole client, with no window of its
own until the button in the panel asks for the popup (see
crate::button). It stays when the popup closes, and leaves when the button does.