Skip to main content

Module app

Module app 

Source
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
    end

What 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.