Skip to main content

Module messages

Module messages 

Source
Expand description

Application messages for Avestruz.

This module defines all the messages that can be sent to update the application state.

A message is the only thing that changes the model (see crate::guide::architecture). There are three kinds of them, told apart by where they come from:

flowchart LR
    reader(["The reader"]) -->|"pressed, typed, scrolled"| did["What was done: OpenThread, Like, Publish"]
    timer(["A timer, the config watch, a view that needs a picture"]) --> time["What is due: CheckForNewNotes, SweepStore, LoadImage"]
    task(["A task that finished"]) --> answer["What came back: FeedFetched, ThreadLoaded, Published"]
    did --> update["app: update"]
    time --> update
    answer --> update

A message of the third kind says what it is an answer to (a list’s id, a search’s serial number, an account’s public key), so that its handler can tell an answer that came too late from one that is still wanted.

Messages are Debug, and may end up in a log: one that would carry what is typed in the sign-in field carries a SecretInput instead, which prints nothing.

Structs§

SecretInput
Text from the sign-in field, which may be a secret key.

Enums§

AttachFailure
Why a file was not attached to what is being written.
Message
Application messages for state updates
PublishFailure
Why what was written, or a repost, did not go out.