pub struct AppModel {Show 60 fields
pub core: Core,
pub config: Config,
pub popup: Option<Id>,
pub keeper: Id,
pub popup_unfocused_at: Option<Instant>,
pub unread_told: bool,
pub view_state: ViewState,
pub screen: Option<Screen>,
pub nostr: Option<NostrService>,
pub account: Option<Account>,
pub login_input: String,
pub login_input_hidden: bool,
pub login_error: Option<CredentialError>,
pub login_refusal: Option<BunkerRefusal>,
pub login_progress: LoginProgress,
pub signer: Signer,
pub following: FeedState,
pub follows: Option<Vec<PublicKey>>,
pub feeds_made: u64,
pub feed_checked_at: Option<Instant>,
pub feed_modes: SingleSelectModel,
pub notifications: NotificationsState,
pub notification_tabs: SingleSelectModel,
pub pages: Vec<Page>,
pub composer: Option<Composer>,
pub compose_tabs: SingleSelectModel,
pub drafts: Drafts,
pub draft_path: PathBuf,
pub drafts_kept: HashMap<Target, String>,
pub drafts_asked: bool,
pub zap: Option<ZapState>,
pub engagement: HashMap<EventId, Engagement>,
pub engagement_asked: HashMap<EventId, Instant>,
pub seen_on: HashMap<EventId, Vec<RelayUrl>>,
pub pending_marks: HashSet<(EventId, Mark)>,
pub repost_menu: Option<RepostMenu>,
pub reaction_menu: Option<ReactionMenu>,
pub who_menu: Option<WhoMenu>,
pub reaction_suggestions: Vec<String>,
pub share_copied: Option<EventId>,
pub picture_copied: Option<String>,
pub bookmarks: BookmarkState,
pub bookmarks_asked_at: Option<Instant>,
pub bookmark_pending: Option<(EventId, bool)>,
pub bookmark_first_list: bool,
pub swept_at: Option<Instant>,
pub menu_open: bool,
pub relays: RelaysState,
pub media: MediaState,
pub profiles: HashMap<PublicKey, Profile>,
pub profiles_requested: HashSet<PublicKey>,
pub nip05: HashMap<PublicKey, Nip05Check>,
pub follow_pending: Option<PublicKey>,
pub images: ImageStore,
pub image_requests: Inbox<ImageRequest>,
pub previews: PreviewStore,
pub preview_requests: Inbox<String>,
pub videos: Videos,
pub http: Client,
pub error_message: Option<String>,
}Expand description
The application model stores app-specific state used to describe its interface and drive its logic.
Fields§
§core: CoreApplication state which is managed by the COSMIC runtime.
config: ConfigConfiguration data that persists between application runs.
popup: Option<Id>The popup id.
keeper: IdThe surface that is there for as long as the window runs, and shows
nothing: what is copied is kept for as long as it is (see
keep_what_is_copied).
popup_unfocused_at: Option<Instant>When the popup last closed because something outside it was clicked: a press of the panel button is such a click, and is heard of a moment later.
unread_told: boolWhat the button in the panel was last told: whether there is something the account has not looked at.
view_state: ViewStateWhich view the popup shows.
screen: Option<Screen>The screen the popup opens on: how tall it is, which the popup’s
own height is a share of, and how many of its pixels a point is,
which pictures are kept by. None until that is known.
nostr: Option<NostrService>The relay client and event store, once the store is open.
account: Option<Account>The signed-in account. None when signed out, and at startup until
the account the config names has been looked up.
login_input: StringWhat is typed in the sign-in field. May be a secret key: it is cleared as soon as it has been used.
Whether the sign-in field hides what is typed.
login_error: Option<CredentialError>Why the last sign-in attempt was refused.
login_refusal: Option<BunkerRefusal>The last sign-in with a bunker address was turned down. Shown under the field until what is in the field changes.
login_progress: LoginProgressHow far the sign-in under way has got.
signer: SignerWhat signs for the account: its key from the keyring, or its remote signer.
following: FeedStateThe feed: notes from the people the account follows.
follows: Option<Vec<PublicKey>>Who the account follows, by its contact list. None until that is
known; empty when it follows nobody.
feeds_made: u64How many lists of notes there have been: the next one’s
FeedState::id comes after.
feed_checked_at: Option<Instant>When the feed was last looked at for new notes.
feed_modes: SingleSelectModelThe choice between the ways a list of notes is read, as the control
that offers it keeps it: each choice carries its
FeedMode, and
the one chosen is Config::feed_mode.
notifications: NotificationsStateWhat the account is told of.
notification_tabs: SingleSelectModelWhich of it shows: everything, or one kind.
pages: Vec<Page>What was opened over the feed, one page from another, and not closed yet. The last is the one on show, and Back closes it.
composer: Option<Composer>The note or reply being written, while the composer is open.
compose_tabs: SingleSelectModelThe choice between writing it and looking at how it would show, as
the control that offers it keeps it: each choice carries whether it
is the look, and the one chosen is whether Composer::preview is
there.
drafts: DraftsWhat was written and left unpublished, by what it was written to.
draft_path: PathBufWhere the draft of a new note is kept between runs.
drafts_kept: HashMap<Target, String>The drafts as the relay of this machine has them, for those it has: what is sent there is what differs from this.
drafts_asked: boolWhether that relay was asked for the account’s drafts.
zap: Option<ZapState>The note being zapped, while the zap view is open.
engagement: HashMap<EventId, Engagement>What was made of the notes seen: replies, reposts, likes and zaps.
engagement_asked: HashMap<EventId, Instant>When each note’s engagement was last asked for, so that it isn’t asked again right away.
seen_on: HashMap<EventId, Vec<RelayUrl>>The relays each note was seen on, for the notes seen on any.
pending_marks: HashSet<(EventId, Mark)>The likes and reposts that are on their way to the relays, by note.
The repost menu that is open, if one is: repost a note, or quote it.
What to react with is on offer, for one note.
Who left something on a note is on show, for one of its counts.
reaction_suggestions: Vec<String>The emoji offered first to react with: the ones used most (see
crate::emoji::suggested), as the settings have them now.
The note a share link to which was copied last, while the popup that was done in is open: its row says so.
picture_copied: Option<String>The picture that was copied just now, if one was: where it is.
bookmarks: BookmarkStateWhat the account has bookmarked.
bookmarks_asked_at: Option<Instant>When that was last asked for.
bookmark_pending: Option<(EventId, bool)>The note being bookmarked (true) or having its bookmark taken
off, while the changed bookmark list is on its way. One at a time:
each change is made to the list the last one left.
bookmark_first_list: boolThe relays had no bookmark list of the account’s when a note was last bookmarked, and the account was told: bookmarking again writes the first.
swept_at: Option<Instant>When the event store was last told to let go of what is old.
The menu behind the cog above the feed is open.
relays: RelaysStateThe account’s relays, as the relays page has them.
media: MediaStateThe account’s media servers, as their page has them, and the files on their way to them.
profiles: HashMap<PublicKey, Profile>What is known about note authors.
profiles_requested: HashSet<PublicKey>The authors whose profile has been asked for, found or not, so that nobody is asked about twice.
nip05: HashMap<PublicKey, Nip05Check>Whether the names people give as theirs are, for those whose profile was opened: nobody else’s domain is asked.
follow_pending: Option<PublicKey>The person being followed or unfollowed, while the changed contact list is on its way. One at a time: each change is made to the list the last one left.
images: ImageStoreAvatars and the images in notes, as far as they have loaded.
image_requests: Inbox<ImageRequest>The pictures views have asked images for, waiting to be turned into
messages by a subscription.
previews: PreviewStoreWhat the web pages notes link to say of themselves, as far as they were asked.
preview_requests: Inbox<String>The pages views have asked previews about, waiting likewise.
videos: VideosThe video that plays, or did last, in the row of the note that links to it.
http: ClientThe HTTP client everything from the web is fetched with.
error_message: Option<String>Something went wrong that the user should know about.
Implementations§
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn save_config(&self, what: &str)
pub(crate) fn save_config(&self, what: &str)
Write the whole config to COSMIC’s config store, logging (not
failing) if that doesn’t work. what names the change, for the log.
Sourcepub(crate) fn clear_login(&mut self)
pub(crate) fn clear_login(&mut self)
Empty the sign-in field and forget its error. The field may hold a secret key, so it is not left lying around once it has served. A sign-in still waiting on a remote signer is called off: whoever left the sign-in view is not to be signed in a minute later.
Sourcepub fn handle_login_input_changed(&mut self, input: SecretInput)
pub fn handle_login_input_changed(&mut self, input: SecretInput)
The user edited the sign-in field.
Sourcepub fn handle_submit_login(&mut self) -> Task<Action<Message>>
pub fn handle_submit_login(&mut self) -> Task<Action<Message>>
Sign in with what is in the sign-in field.
Sourcefn enter_account(&mut self, account: Account) -> Task<Action<Message>>
fn enter_account(&mut self, account: Account) -> Task<Action<Message>>
account is the one in use from now on: who it follows, which
fills its feed, is found out.
Sourcepub fn handle_login_complete(
&mut self,
result: Result<Account, SignInError>,
) -> Task<Action<Message>>
pub fn handle_login_complete( &mut self, result: Result<Account, SignInError>, ) -> Task<Action<Message>>
Signing in finished. On success the account is remembered and its feed shows; if the keyring refused, or the remote signer did, nobody is signed in.
Sourcepub fn handle_copy_client_key(&mut self) -> Task<Action<Message>>
pub fn handle_copy_client_key(&mut self) -> Task<Action<Message>>
Copy the key the signer that turned the sign-in down would have to know this client by.
Sourcepub fn handle_account_restored(
&mut self,
result: Result<Account, String>,
) -> Task<Action<Message>>
pub fn handle_account_restored( &mut self, result: Result<Account, String>, ) -> Task<Action<Message>>
The account named in the config was looked up at startup.
Sourcepub fn handle_sign_out(&mut self) -> Task<Action<Message>>
pub fn handle_sign_out(&mut self) -> Task<Action<Message>>
Sign the account out: forget it, take what it signs with out of the keyring, and let go of its remote signer.
Sourcepub fn handle_signed_out(&mut self, result: Result<(), String>)
pub fn handle_signed_out(&mut self, result: Result<(), String>)
The secret key left the keyring, or the keyring refused. A key that is still there is worth knowing about.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn reset_bookmarks(&mut self)
pub(crate) fn reset_bookmarks(&mut self)
Forget the bookmarks: the account changed, and they were its own.
Sourcefn bookmarking_account(&self) -> Option<PublicKey>
fn bookmarking_account(&self) -> Option<PublicKey>
The account that keeps bookmarks: the one signed in, if it has its key.
Sourcepub(crate) fn load_bookmarks(&mut self) -> Task<Action<Message>>
pub(crate) fn load_bookmarks(&mut self) -> Task<Action<Message>>
Find out what the account has bookmarked, while the popup is open and unless that was asked a moment ago. Called whenever the popup opens, and when the account or the store arrive.
Sourcefn ask_bookmarks(&self, source: Source) -> Option<Task<Action<Message>>>
fn ask_bookmarks(&self, source: Source) -> Option<Task<Action<Message>>>
Ask source what the account has bookmarked, if there is an
account that keeps bookmarks, and a store.
Sourcefn known_bookmarks(&self) -> Option<&Bookmarks>
fn known_bookmarks(&self) -> Option<&Bookmarks>
The bookmarks, if they are known.
Sourcefn take_bookmarks(&mut self, bookmarks: Bookmarks) -> Task<Action<Message>>
fn take_bookmarks(&mut self, bookmarks: Bookmarks) -> Task<Action<Message>>
The account’s bookmarks are bookmarks, unless what is known is
from a newer list: answers come from the store and from the relays,
in no order that can be counted on. An open bookmarks page takes
its notes from them.
Sourcepub fn handle_bookmarks_loaded(
&mut self,
account: PublicKey,
source: Source,
result: Result<Bookmarks, ListError>,
) -> Task<Action<Message>>
pub fn handle_bookmarks_loaded( &mut self, account: PublicKey, source: Source, result: Result<Bookmarks, ListError>, ) -> Task<Action<Message>>
What the account has bookmarked came from the store or from the relays, or didn’t. After the store, the relays are asked.
Sourcefn bookmarked_notes_mut(&mut self, id: u64) -> Option<&mut BookmarkedNotes>
fn bookmarked_notes_mut(&mut self, id: u64) -> Option<&mut BookmarkedNotes>
The notes of the bookmarks page id, if that page is still open.
Sourcefn fill_bookmarks_pages(&mut self) -> Task<Action<Message>>
fn fill_bookmarks_pages(&mut self) -> Task<Action<Message>>
Have every open bookmarks page take its notes from the bookmarks, which are known now or are others than they were, if it was never filled or is at its top. Then look up the first of them.
Sourcepub fn handle_open_bookmarks(&mut self) -> Task<Action<Message>>
pub fn handle_open_bookmarks(&mut self) -> Task<Action<Message>>
Show the notes the account has bookmarked, over whatever is on show now. The bookmarks are asked for again if that was a while ago.
Sourcepub fn handle_load_bookmarked_notes(
&mut self,
page: u64,
) -> Task<Action<Message>>
pub fn handle_load_bookmarked_notes( &mut self, page: u64, ) -> Task<Action<Message>>
Look up the next notes of the bookmarks page page, unless they
are being looked up or there are no more.
Sourcepub fn handle_bookmarked_notes_loaded(
&mut self,
page: u64,
taken: u64,
from: usize,
to: usize,
notes: Vec<Note>,
) -> Task<Action<Message>>
pub fn handle_bookmarked_notes_loaded( &mut self, page: u64, taken: u64, from: usize, to: usize, notes: Vec<Note>, ) -> Task<Action<Message>>
The notes bookmarked fromth to toth were looked up for the page
page, as it had them the takenth time: notes are those that
were found, which go under the ones already there. A page that
brought none is followed by the next at once: nothing was added to
the list that scrolling could reach the end of.
Sourcepub fn handle_bookmark(&mut self, id: EventId) -> Task<Action<Message>>
pub fn handle_bookmark(&mut self, id: EventId) -> Task<Action<Message>>
Bookmark the note id, or take its bookmark off if it has one.
Not while another change is on its way, nor before the bookmarks
are known; and if they could not be read, that is said again.
Sourcepub fn handle_bookmarked(
&mut self,
account: PublicKey,
id: EventId,
result: Result<Bookmarks, ListError>,
)
pub fn handle_bookmarked( &mut self, account: PublicKey, id: EventId, result: Result<Bookmarks, ListError>, )
The bookmark list of account was changed for the note id, or
wasn’t.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn can_publish(&self) -> bool
pub(crate) fn can_publish(&self) -> bool
Whether the account can publish: someone is signed in with a key.
Sourcefn open_composer(
&mut self,
target: Target,
about: Option<Note>,
) -> Task<Action<Message>>
fn open_composer( &mut self, target: Target, about: Option<Note>, ) -> Task<Action<Message>>
Open the composer on target, which is about about if it is about
a note, with what was written to it before, the cursor after it, and
the keyboard in the text.
Sourcepub fn handle_select_compose_tab(
&mut self,
chosen: Entity,
) -> Task<Action<Message>>
pub fn handle_select_compose_tab( &mut self, chosen: Entity, ) -> Task<Action<Message>>
Writing, or looking at how what is written would show, was chosen
in the control above the text: chosen is that choice in it.
Sourcepub fn handle_toggle_compose_preview(&mut self) -> Task<Action<Message>>
pub fn handle_toggle_compose_preview(&mut self) -> Task<Action<Message>>
Ctrl+P: the other of the two. Nothing, where nothing is being written.
Sourcefn show_compose_preview(&mut self, preview: bool) -> Task<Action<Message>>
fn show_compose_preview(&mut self, preview: bool) -> Task<Action<Message>>
Show what is written as it would show once out (preview), or the
text again, with the keyboard back in it. A video that played in
what is not looked at any more is held.
Sourcefn preview_composed(&mut self) -> Task<Action<Message>>
fn preview_composed(&mut self) -> Task<Action<Message>>
Put together how what is in the composer would show, as it is now:
what Self::handle_publish would send, read as a row reads a
note, with what it says of the files attached to it. The note a
quote is about is at hand; any other that the text names is looked
for, and so is everyone it mentions.
Sourcepub(crate) fn preview_composed_anew(&mut self) -> Task<Action<Message>>
pub(crate) fn preview_composed_anew(&mut self) -> Task<Action<Message>>
What is in the composer changed while how it would show is looked at, and not by being written to: a file attached to it got where it was going. It shows as it is now.
Sourcepub fn handle_compose_previewed(&mut self, note: Note) -> Task<Action<Message>>
pub fn handle_compose_previewed(&mut self, note: Note) -> Task<Action<Message>>
The notes that what is being written quotes were looked for: note
is it with those that were found. Nothing, if it says something
else by now, or is not looked at any more.
Sourcepub fn handle_compose_note(&mut self) -> Task<Action<Message>>
pub fn handle_compose_note(&mut self) -> Task<Action<Message>>
Write a new note.
Sourcepub fn handle_compose_reply(&mut self, id: EventId) -> Task<Action<Message>>
pub fn handle_compose_reply(&mut self, id: EventId) -> Task<Action<Message>>
Write a reply to the note id, which is one on show.
Sourcepub fn handle_compose_quote(&mut self, id: EventId) -> Task<Action<Message>>
pub fn handle_compose_quote(&mut self, id: EventId) -> Task<Action<Message>>
Write a note that quotes the note id, which is one on show.
Sourcepub fn handle_compose_edited(&mut self, action: Action)
pub fn handle_compose_edited(&mut self, action: Action)
Something was typed, selected or moved in the composer. Nothing is, while what is there is on its way out.
Sourcepub fn handle_composer_rubbed_out(&mut self) -> Task<Action<Message>>
pub fn handle_composer_rubbed_out(&mut self) -> Task<Action<Message>>
Backspace was pressed in the composer’s text with nothing left in
it to rub out: leave the composer (see Self::handle_abandon_composer).
Not if it is the Backspace that rubbed out the last of the text,
still held down: that one was rubbing out, and goes on doing
nothing until it is let go.
Sourcepub fn handle_abandon_composer(&mut self) -> Task<Action<Message>>
pub fn handle_abandon_composer(&mut self) -> Task<Action<Message>>
Backspace was pressed to leave the composer: with nothing in the
text, or with the keyboard out of the text. With nothing written
it is left, and there is no draft. With something written, it is
asked whether that is kept as a draft; and pressed again once that
is asked, the answer is no (see Leaving). Nothing, while what
was written is on its way out.
Sourcepub fn handle_discard_draft(&mut self) -> Task<Action<Message>>
pub fn handle_discard_draft(&mut self) -> Task<Action<Message>>
Leave the composer and keep nothing of what was written: its target has no draft any more, here or on the relay of this machine, and the files that were on their way to be attached to it are called off.
Sourcepub fn handle_resume_composer(&mut self) -> Task<Action<Message>>
pub fn handle_resume_composer(&mut self) -> Task<Action<Message>>
Not leaving the composer after all: the question is put away, and the keyboard is back in the text.
Sourcepub(crate) fn keep_draft(&mut self) -> Task<Action<Message>>
pub(crate) fn keep_draft(&mut self) -> Task<Action<Message>>
Keep what is in the composer as its target’s draft, and have the relay of this machine keep it.
Sourcepub(crate) fn send_draft(&mut self, target: Target) -> Task<Action<Message>>
pub(crate) fn send_draft(&mut self, target: Target) -> Task<Action<Message>>
Have the relay of this machine keep the draft for target as it
is now, with what it says of the files it links to, unless that is
how it has it. It takes the account’s key: the draft is encrypted
to the account and signed. Where that can’t
be asked for, the draft of a new note goes to its file.
Sourcepub fn handle_draft_kept(
&mut self,
account: PublicKey,
target: Target,
text: String,
result: Result<(), String>,
) -> Task<Action<Message>>
pub fn handle_draft_kept( &mut self, account: PublicKey, target: Target, text: String, result: Result<(), String>, ) -> Task<Action<Message>>
The relay of this machine took text as the draft of account
for target, or didn’t. Taken, the file a new note’s draft used
to be kept in is not needed; not taken, that file is where the
draft of a new note goes, so that it is there after a restart.
Sourcepub(crate) fn load_drafts(&mut self) -> Task<Action<Message>>
pub(crate) fn load_drafts(&mut self) -> Task<Action<Message>>
Ask the relay of this machine for the account’s drafts, once for an account, while the popup is open: reading them takes the key.
Sourcepub fn handle_kept_drafts_loaded(
&mut self,
account: PublicKey,
result: Result<Vec<(Target, String, Vec<Tag>)>, String>,
)
pub fn handle_kept_drafts_loaded( &mut self, account: PublicKey, result: Result<Vec<(Target, String, Vec<Tag>)>, String>, )
The relay of this machine said which drafts of account it keeps.
Whatever has been written since is newer.
Sourcepub(crate) fn reset_kept_drafts(&mut self)
pub(crate) fn reset_kept_drafts(&mut self)
Forget which drafts the relay of this machine has: the account changed, and they were its own.
Sourcefn save_note_draft(&self, target: Target) -> Task<Action<Message>>
fn save_note_draft(&self, target: Target) -> Task<Action<Message>>
Write the draft of a new note to its file, if target is that: where
it is kept when the relay of this machine can’t be given it.
Sourcepub fn handle_draft_loaded(&mut self, text: String)
pub fn handle_draft_loaded(&mut self, text: String)
The draft of a new note was read at startup. Whatever has been written since is newer.
Sourcepub fn handle_close_composer(&mut self) -> Task<Action<Message>>
pub fn handle_close_composer(&mut self) -> Task<Action<Message>>
Leave the composer for the view it was opened from, keeping what was written.
Sourcepub fn handle_publish(&mut self) -> Task<Action<Message>>
pub fn handle_publish(&mut self) -> Task<Action<Message>>
Sign what is in the composer and send it to the relays.
Sourcepub fn handle_published(
&mut self,
target: Target,
result: Result<Note, PublishFailure>,
) -> Task<Action<Message>>
pub fn handle_published( &mut self, target: Target, result: Result<Note, PublishFailure>, ) -> Task<Action<Message>>
What was written to target went out, or didn’t.
Sourcefn show_published(
&mut self,
target: Target,
note: Note,
) -> Task<Action<Message>>
fn show_published( &mut self, target: Target, note: Note, ) -> Task<Action<Message>>
Put a note that just went out where it belongs: a new note or a quote at the top of the feed, brought into view, with the notes that waited; a reply in every open thread that has the note it answers; and any of them among its author’s notes, wherever their profile is open.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn look_up_engagement(
&mut self,
notes: impl IntoIterator<Item = EventId>,
) -> Task<Action<Message>>
pub(crate) fn look_up_engagement( &mut self, notes: impl IntoIterator<Item = EventId>, ) -> Task<Action<Message>>
Find out what was made of notes, those of them that were not asked
about just now: from the event store at once, from the relays after.
Sourcepub(crate) fn reset_engagement(&mut self)
pub(crate) fn reset_engagement(&mut self)
Forget what was made of the notes seen: the account changed, and whose likes and reposts are its own with it.
Sourcepub fn handle_engagement_loaded(
&mut self,
source: Source,
account: Option<PublicKey>,
result: Result<Standing, FetchError>,
)
pub fn handle_engagement_loaded( &mut self, source: Source, account: Option<PublicKey>, result: Result<Standing, FetchError>, )
What was made of some notes came from the store or from the relays (or didn’t: the counts are not worth a banner).
Sourcepub fn handle_show_who(
&mut self,
id: EventId,
what: Left,
) -> Task<Action<Message>>
pub fn handle_show_who( &mut self, id: EventId, what: Left, ) -> Task<Action<Message>>
Show who left what on the note id, under the count of them, or
put that away if it is what shows. They are read from the store,
which is where they were counted from.
Sourcepub fn handle_who_loaded(
&mut self,
note: EventId,
what: Left,
result: Result<Vec<Doer>, FetchError>,
) -> Task<Action<Message>>
pub fn handle_who_loaded( &mut self, note: EventId, what: Left, result: Result<Vec<Doer>, FetchError>, ) -> Task<Action<Message>>
Who left what on note was read, or could not be, which shows
as nobody having. Nothing comes of it if that is no longer what is
asked for. Those of them who are not known yet are asked after, as
many as are shown.
Show what can be done to pass the note id on, or put it away if
it is showing.
Sourcepub(crate) fn suggest_reactions(&mut self)
pub(crate) fn suggest_reactions(&mut self)
Work out again which emoji are offered first to react with: what the settings have of the ones used changed.
Offer what to react to the note id with, or put the offer away
if it is showing.
Sourcepub fn handle_open_emoji_picker(&mut self) -> Task<Action<Message>>
pub fn handle_open_emoji_picker(&mut self) -> Task<Action<Message>>
Show every emoji there is, in place of the few offered first, with the field to find one by ready to be typed in.
Sourcefn emoji_picker_mut(&mut self) -> Option<&mut EmojiPicker>
fn emoji_picker_mut(&mut self) -> Option<&mut EmojiPicker>
The emoji picker, if it is open.
Sourcepub fn handle_emoji_search_typed(&mut self, typed: String)
pub fn handle_emoji_search_typed(&mut self, typed: String)
What to find an emoji by was typed.
Sourcepub fn handle_emoji_group(&mut self, group: Group)
pub fn handle_emoji_group(&mut self, group: Group)
Another group of emoji was chosen to pick from: it shows, and what was typed to find one by is dropped, which would hide it.
Sourcepub fn handle_react(
&mut self,
id: EventId,
reaction: Reaction,
) -> Task<Action<Message>>
pub fn handle_react( &mut self, id: EventId, reaction: Reaction, ) -> Task<Action<Message>>
React to the note id with reaction. An emoji reacted with is
one to offer again: it is noted in the settings, whatever comes of
the reaction.
Sourcepub fn handle_mark(&mut self, id: EventId, mark: Mark) -> Task<Action<Message>>
pub fn handle_mark(&mut self, id: EventId, mark: Mark) -> Task<Action<Message>>
Leave mark on the note id, which is one on show: react to it,
or repost it. Once is enough: a note that carries a mark of that
kind stays as it is.
Sourcepub fn handle_marked(
&mut self,
id: EventId,
mark: Mark,
result: Result<(), PublishFailure>,
)
pub fn handle_marked( &mut self, id: EventId, mark: Mark, result: Result<(), PublishFailure>, )
The reaction to the note id, or its repost, went out, or didn’t.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn new_feed(&mut self) -> FeedState
pub(crate) fn new_feed(&mut self) -> FeedState
A new, empty list of notes, with an id no list had before.
Sourcefn feed_mut(&mut self, id: u64) -> Option<&mut FeedState>
fn feed_mut(&mut self, id: u64) -> Option<&mut FeedState>
The list of notes id, if it is still there: the feed, or the notes
of an open profile.
Whose notes the list id is made of. None if the list is gone,
and for the feed while who is followed isn’t known.
Sourcepub fn handle_nostr_ready(
&mut self,
result: Result<NostrService, String>,
) -> Task<Action<Message>>
pub fn handle_nostr_ready( &mut self, result: Result<NostrService, String>, ) -> Task<Action<Message>>
The event store opened (or didn’t). Find out about the account, if someone is signed in already: who they follow fills the feed.
Sourcepub(crate) fn load_feed(&mut self, id: u64) -> Task<Action<Message>>
pub(crate) fn load_feed(&mut self, id: u64) -> Task<Action<Message>>
Fill the list id: what the store holds of it now, and the newest
page from the relays after.
Sourcepub(crate) fn fetch_feed(
&mut self,
id: u64,
page: FeedPage,
) -> Task<Action<Message>>
pub(crate) fn fetch_feed( &mut self, id: u64, page: FeedPage, ) -> Task<Action<Message>>
Ask the relays for a page of the list id, unless that page is
already on its way (or, for an older page, there is nothing older).
Sourcepub fn handle_feed_cached(
&mut self,
id: u64,
result: Result<Vec<Note>, String>,
) -> Task<Action<Message>>
pub fn handle_feed_cached( &mut self, id: u64, result: Result<Vec<Note>, String>, ) -> Task<Action<Message>>
The notes of the list id already in the event store were read:
what it shows until the relays answer. Once they have, the list is
what it is, and the store has nothing to add to it, unless they
answered with nothing.
Sourcepub fn handle_feed_fetched(
&mut self,
id: u64,
page: FeedPage,
until: Option<u64>,
result: Result<Vec<Note>, FetchError>,
) -> Task<Action<Message>>
pub fn handle_feed_fetched( &mut self, id: u64, page: FeedPage, until: Option<u64>, result: Result<Vec<Note>, FetchError>, ) -> Task<Action<Message>>
A page of the list id arrived from the relays (or didn’t): the
newest there is, or the page before the note written at until.
Sourcefn handle_newest_fetched(
&mut self,
id: u64,
result: Result<Vec<Note>, FetchError>,
) -> Task<Action<Message>>
fn handle_newest_fetched( &mut self, id: u64, result: Result<Vec<Note>, FetchError>, ) -> Task<Action<Message>>
The newest notes of the list id arrived from the relays (or
didn’t).
They go into the list itself only while nobody can have been reading it: when it is empty, or being filled for the first time and still at its top. After that they wait to be asked for, and what is on show stays as it is, unless this page was asked for by hand.
Sourcefn handle_older_fetched(
&mut self,
id: u64,
until: Option<u64>,
result: Result<Vec<Note>, FetchError>,
) -> Task<Action<Message>>
fn handle_older_fetched( &mut self, id: u64, until: Option<u64>, result: Result<Vec<Note>, FetchError>, ) -> Task<Action<Message>>
The page of the list id before the note written at until
arrived from the relays (or didn’t).
Sourcefn list_on_show(&self, id: u64) -> bool
fn list_on_show(&self, id: u64) -> bool
Whether the list id is what the popup shows, or would if it were
open.
Sourcepub fn show_new_notes(&mut self, id: u64) -> Task<Action<Message>>
pub fn show_new_notes(&mut self, id: u64) -> Task<Action<Message>>
Show the notes that wait for the list id, which its reader asked
for, and bring the list to its top, where they are.
Notes that reach down to the list’s newest go in above it. Notes that may not start the list over: it is then those, and what is older comes back as the list is scrolled to its end.
Sourcepub fn handle_check_for_new_notes(&mut self) -> Task<Action<Message>>
pub fn handle_check_for_new_notes(&mut self) -> Task<Action<Message>>
It is time to look for new notes for the feed. Whatever there is waits to be asked for.
Sourcepub(crate) fn check_for_new_notes_if_stale(&mut self) -> Task<Action<Message>>
pub(crate) fn check_for_new_notes_if_stale(&mut self) -> Task<Action<Message>>
Look for new notes for the feed now, if that was not done just now: the popup opened, and whoever opened it is about to look.
Sourcepub fn handle_load_older_notes(&mut self, id: u64) -> Task<Action<Message>>
pub fn handle_load_older_notes(&mut self, id: u64) -> Task<Action<Message>>
The list id was scrolled near its end, or asked to look further
back: the page before its oldest note, however many pages before
brought nothing to show.
Sourcefn look_back_if_nothing_to_show(&mut self, id: u64) -> Task<Action<Message>>
fn look_back_if_nothing_to_show(&mut self, id: u64) -> Task<Action<Message>>
Look further back for the list id if it has notes and none of
them to show: nothing is there to scroll to the end of, which is
what otherwise asks for the next page.
Sourcepub fn handle_select_feed_mode(
&mut self,
chosen: Entity,
) -> Task<Action<Message>>
pub fn handle_select_feed_mode( &mut self, chosen: Entity, ) -> Task<Action<Message>>
Which notes the lists show was chosen, above one of them: chosen
is that choice in the control. Kept, and shown from now on.
Sourcepub(crate) fn show_feed_mode(&mut self) -> Task<Action<Message>>
pub(crate) fn show_feed_mode(&mut self) -> Task<Action<Message>>
Show every list as crate::config::Config::feed_mode has it,
which just changed: the control says so, and each list starts
counting pages with nothing to show over again, looking back at
once if it has nothing. The feed, if it is on show, is read from
its top.
Sourcepub fn handle_refresh_feed(&mut self) -> Task<Action<Message>>
pub fn handle_refresh_feed(&mut self) -> Task<Action<Message>>
Refresh was pressed: the newest notes of the feed, shown as soon as they are here, with whatever waited already. While who is followed isn’t known, that is asked first.
Sourcepub(crate) fn restore_feed_position(&self) -> Task<Action<Message>>
pub(crate) fn restore_feed_position(&self) -> Task<Action<Message>>
Scroll the feed to where it was left: the scroller has the place of whatever list it showed last.
Sourcepub(crate) fn merge_notes(
&mut self,
id: u64,
notes: Vec<Note>,
) -> Task<Action<Message>>
pub(crate) fn merge_notes( &mut self, id: u64, notes: Vec<Note>, ) -> Task<Action<Message>>
Add notes to the list id, if it is still there, and look up the
people they are shown with (authors, and those mentioned) and what
was made of them.
Sourcepub(crate) fn look_up_people(
&mut self,
people: Vec<PublicKey>,
) -> Task<Action<Message>>
pub(crate) fn look_up_people( &mut self, people: Vec<PublicKey>, ) -> Task<Action<Message>>
Look up the profiles of those of people who were not asked about
yet: first in the event store, which answers at once.
Sourcepub fn handle_profiles_cached(
&mut self,
requested: Vec<PublicKey>,
found: Vec<(PublicKey, Profile)>,
) -> Task<Action<Message>>
pub fn handle_profiles_cached( &mut self, requested: Vec<PublicKey>, found: Vec<(PublicKey, Profile)>, ) -> Task<Action<Message>>
Profiles were read from the event store. Ask the relays for the authors it didn’t know.
Sourcepub fn handle_profiles_fetched(
&mut self,
found: Vec<(PublicKey, Profile)>,
) -> Task<Action<Message>>
pub fn handle_profiles_fetched( &mut self, found: Vec<(PublicKey, Profile)>, ) -> Task<Action<Message>>
Profiles arrived, as they stand now.
Sourcefn keep_profiles(
&mut self,
found: Vec<(PublicKey, Profile)>,
) -> Task<Action<Message>>
fn keep_profiles( &mut self, found: Vec<(PublicKey, Profile)>, ) -> Task<Action<Message>>
Keep found as what is known of those people. Those of them whose
profile is open may have a name to check that they hadn’t before.
Sourcepub(crate) fn reset_following(&mut self)
pub(crate) fn reset_following(&mut self)
Forget who is followed and the feed made of their notes: the account changed. Anything still on its way for the old one is dropped.
Sourcepub(crate) fn load_account(&mut self) -> Task<Action<Message>>
pub(crate) fn load_account(&mut self) -> Task<Action<Message>>
Find out about the account: who it follows, which fills the feed, what it says of itself, which is its picture above the feed, and, if the popup is open, what it has bookmarked. Does nothing until both the account and the store are there; it is called when either arrives.
Sourcefn use_account_relays(&self) -> Task<Action<Message>>
fn use_account_relays(&self) -> Task<Action<Message>>
Have the relays the account’s relay list says it writes to join its own: where its lists are, and where what it writes goes. Nothing waits for it: until they have joined, the relays the config names are the account’s own.
Sourcefn load_contacts(&mut self) -> Task<Action<Message>>
fn load_contacts(&mut self) -> Task<Action<Message>>
Find out who the account follows: from the store now, from the relays after.
Sourcepub fn handle_contacts_loaded(
&mut self,
feed: u64,
source: Source,
result: Result<Option<Vec<PublicKey>>, FetchError>,
) -> Task<Action<Message>>
pub fn handle_contacts_loaded( &mut self, feed: u64, source: Source, result: Result<Option<Vec<PublicKey>>, FetchError>, ) -> Task<Action<Message>>
The account’s contact list was read from the store, or came back
from the relays, asked for the feed feed: if that is not the feed
any more, neither is the answer.
Sourcepub(crate) fn set_follows(
&mut self,
follows: Vec<PublicKey>,
) -> Task<Action<Message>>
pub(crate) fn set_follows( &mut self, follows: Vec<PublicKey>, ) -> Task<Action<Message>>
The account follows follows. If that is news, the feed starts over
with them.
Source§impl AppModel
impl AppModel
Sourcepub fn handle_load_image(
&mut self,
request: ImageRequest,
) -> Task<Action<Message>>
pub fn handle_load_image( &mut self, request: ImageRequest, ) -> Task<Action<Message>>
A view asked for a picture. Fetch it, unless it is here, failed, or on its way already, or too many others are.
Sourcepub fn handle_image_loaded(
&mut self,
request: ImageRequest,
result: Result<LoadedImage, String>,
)
pub fn handle_image_loaded( &mut self, request: ImageRequest, result: Result<LoadedImage, String>, )
A picture arrived, or didn’t. Either way the views that wanted it are built again, and the ones still waiting ask again.
Sourcepub fn handle_copy_picture(&mut self, url: String) -> Task<Action<Message>>
pub fn handle_copy_picture(&mut self, url: String) -> Task<Action<Message>>
A picture was clicked with the right button: put it on the clipboard (see the module), and have it say so.
Source§impl AppModel
impl AppModel
Sourcefn keys_are_the_lists(&self) -> bool
fn keys_are_the_lists(&self) -> bool
Whether the keys are a list’s now: the popup is open, and no menu is open over what it shows.
Sourcefn rows_at_the_keys(&self) -> Option<Rows>
fn rows_at_the_keys(&self) -> Option<Rows>
The list on show, as the keyboard goes by it: where its rows
start, from the top of what its scroller holds, what each leads
to, how far it is scrolled, and which row is marked. None where
what is on show is no list.
A row is as tall as it measured, or as its estimate until it has
been in view: the same heights, by the same estimate, as the list
is laid out with (see RowHeights::starts).
Sourcefn mark_on_show(&mut self) -> Option<&mut Option<EventId>>
fn mark_on_show(&mut self) -> Option<&mut Option<EventId>>
Where the list on show keeps which of its rows is marked. None
where what is on show is no list.
Sourcepub fn handle_step_note(&mut self, step: Step) -> Task<Action<Message>>
pub fn handle_step_note(&mut self, step: Step) -> Task<Action<Message>>
j, k or Home was pressed: with a list on show, and nothing
over it, the next row, the one before, or the very top goes to the
top of what is in view, as far as the list scrolls, and the row is
marked (see the module). Anywhere else the keys mean
nothing.
On a profile, who they are is the first place: k from their
first note goes there, and j from there to their first note.
A row below is where the heights of those above it put it, and those have all been in view, coming down from the top: it lands exactly. After a jump over rows never shown, a row above may be off by what its estimate was, as scrolling up to it would be.
Sourcefn row_at_the_keys(&mut self) -> Option<Row>
fn row_at_the_keys(&mut self) -> Option<Row>
The row the keyboard is at, for a key that does something to it.
With no row marked where the view is, that is the row at the top
of what is in view, which is marked: it is where the keyboard is
from then on, and when the list is come back to. None where the
keys are not a list’s, or the list has no row there.
Sourcepub fn handle_open_marked(&mut self) -> Task<Action<Message>>
pub fn handle_open_marked(&mut self) -> Task<Action<Message>>
l or Enter was pressed: open the row the keyboard is at (see
Self::row_at_the_keys), as a click on it does.
y was pressed: copy a link to the note the keyboard is at that
anyone can open, as the chain link under it does.
Sourcepub fn handle_play_marked(&mut self) -> Task<Action<Message>>
pub fn handle_play_marked(&mut self) -> Task<Action<Message>>
Space was pressed: it is for the first thing the note the keyboard
is at links to, pictures apart (see pressed). A video is
played, or held if it plays, as a press of its play button does;
any other link is opened in the browser, as a click on it does.
Sourcepub fn handle_reply_marked(&mut self) -> Task<Action<Message>>
pub fn handle_reply_marked(&mut self) -> Task<Action<Message>>
r was pressed: reply to the note the keyboard is at, as the
arrow under it does. Not by an account that can’t publish.
Sourcepub fn handle_zap_marked(&mut self) -> Task<Action<Message>>
pub fn handle_zap_marked(&mut self) -> Task<Action<Message>>
z was pressed: zap the note the keyboard is at, as the bolt
under it does. Nothing, if its author has nowhere to be zapped.
Sourcepub fn handle_repost_marked(&mut self) -> Task<Action<Message>>
pub fn handle_repost_marked(&mut self) -> Task<Action<Message>>
R was pressed: offer the ways to pass on the note the keyboard
is at, as its repost action does, with the keyboard at the first
that can be taken; or put the offer away, if it is showing. Not
to an account that can’t publish.
Sourcepub fn handle_step_choice(&mut self, step: Step) -> Task<Action<Message>>
pub fn handle_step_choice(&mut self, step: Step) -> Task<Action<Message>>
An arrow up or down was pressed, or j or k with the repost
menu open: the keyboard goes to the next of the ways the menu
offers, or the one before. Nothing, with no such menu open.
Sourcepub fn handle_bookmark_marked(&mut self) -> Task<Action<Message>>
pub fn handle_bookmark_marked(&mut self) -> Task<Action<Message>>
b was pressed: bookmark the note the keyboard is at, or take its
bookmark off if it has one, as the ribbon under it does.
Sourcefn keys_go_elsewhere(&self) -> bool
fn keys_go_elsewhere(&self) -> bool
Whether a list is on show for the keys that go elsewhere from one: the feed, or a page opened over it. Not the composer or a zap, which a stray key would put away, nor where nobody is signed in.
Sourcepub fn handle_go_to_bookmarks(&mut self) -> Task<Action<Message>>
pub fn handle_go_to_bookmarks(&mut self) -> Task<Action<Message>>
B was pressed: show the bookmarks, as the menu does. Not over
the bookmarks themselves: one way back is enough.
Sourcepub fn handle_go_to_search(&mut self) -> Task<Action<Message>>
pub fn handle_go_to_search(&mut self) -> Task<Action<Message>>
s was pressed: show a page to search on, as the magnifying glass
above the feed does, with the keyboard in the place to type in.
Over one already, the keyboard is put there and no other is
opened.
Sourcepub fn handle_show_keys(&mut self) -> Task<Action<Message>>
pub fn handle_show_keys(&mut self) -> Task<Action<Message>>
? was pressed: show what the keys do, in the view that says so.
Sourcepub fn handle_show_waiting(&mut self) -> Task<Action<Message>>
pub fn handle_show_waiting(&mut self) -> Task<Action<Message>>
. was pressed: show the notes that wait for the list on show, as
the button over it does. They are at its top, which is where it
goes, and no row is marked.
Sourcepub fn handle_backspace(&mut self, held: bool) -> Task<Action<Message>>
pub fn handle_backspace(&mut self, held: bool) -> Task<Action<Message>>
Backspace was pressed, or is held down: go back, as h does;
and out of the composer too, which h is not, since Backspace
asks before anything written is lost (see
Self::handle_abandon_composer). Not out of the composer while
it is held: one press, one answer.
Sourcepub fn handle_go_back(&mut self) -> Task<Action<Message>>
pub fn handle_go_back(&mut self) -> Task<Action<Message>>
h was pressed, or Backspace: go back, as the arrow at the top
left of the view on show does. Not out of the composer: an h
that was meant for its text, pressed when the keyboard was not in
it, would put it away. Backspace leaves it, in a way of its own
(see Self::handle_backspace).
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn reset_media(&mut self)
pub(crate) fn reset_media(&mut self)
Forget the account’s media servers, and call off what is on its way to them: the account changed, and they were its own.
Sourcepub(crate) fn load_media_servers(&mut self) -> Task<Action<Message>>
pub(crate) fn load_media_servers(&mut self) -> Task<Action<Message>>
Find out what the account’s media servers are, while the popup is open, unless the relays said already.
Sourcefn ask_media_servers(&mut self, source: Source) -> Task<Action<Message>>
fn ask_media_servers(&mut self, source: Source) -> Task<Action<Message>>
Ask source for the account’s server list, unless it is being
changed: what the change leaves is what it is.
Sourcefn take_media_servers(&mut self, list: Option<Event>)
fn take_media_servers(&mut self, list: Option<Event>)
The servers are what list says from now on. Those on the page
that were not changed there show what it says; changed, they stay
as they are.
Sourcepub fn handle_media_servers_loaded(
&mut self,
account: PublicKey,
source: Source,
result: Result<Option<Event>, FetchError>,
) -> Task<Action<Message>>
pub fn handle_media_servers_loaded( &mut self, account: PublicKey, source: Source, result: Result<Option<Event>, FetchError>, ) -> Task<Action<Message>>
The account’s server list came from the store or from the relays, or didn’t. After the store, the relays are asked.
Sourcepub fn handle_open_media(&mut self) -> Task<Action<Message>>
pub fn handle_open_media(&mut self) -> Task<Action<Message>>
Show the account’s media servers, in place of what is on show, and ask for its list again.
Sourcepub fn handle_close_media(&mut self) -> Task<Action<Message>>
pub fn handle_close_media(&mut self) -> Task<Action<Message>>
Leave the media servers: for the composer, if something is being written, and for the list that was on show otherwise.
Sourcepub(crate) fn media_can_change(&self) -> bool
pub(crate) fn media_can_change(&self) -> bool
Whether the servers can be changed now: by an account with its key, once the relays have said what its list is, while no change is on its way.
Sourcepub fn handle_add_media_server(&mut self)
pub fn handle_add_media_server(&mut self)
Add the server typed, on the page: nothing is written until the servers are saved.
Sourcepub fn handle_remove_media_server(&mut self, server: &Url)
pub fn handle_remove_media_server(&mut self, server: &Url)
Take server out, on the page.
Sourcepub fn handle_shift_media_server(&mut self, server: &Url, up: bool)
pub fn handle_shift_media_server(&mut self, server: &Url, up: bool)
Move server a place up, or down, on the page.
Sourcepub(crate) fn media_can_save(&self) -> bool
pub(crate) fn media_can_save(&self) -> bool
Whether there is anything to save, and it can be saved now.
Sourcepub fn handle_save_media_servers(&mut self) -> Task<Action<Message>>
pub fn handle_save_media_servers(&mut self) -> Task<Action<Message>>
Write the servers as the page has them to the account’s list.
Sourcepub fn handle_media_servers_saved(
&mut self,
account: PublicKey,
result: Result<Option<Event>, ListError>,
)
pub fn handle_media_servers_saved( &mut self, account: PublicKey, result: Result<Option<Event>, ListError>, )
The account’s server list was changed, or wasn’t. What was not saved stays on the page, changed, to be saved again.
Sourcefn can_attach(&self) -> bool
fn can_attach(&self) -> bool
Whether something can be attached to what is being written now: it is being written, by an account with its key, and is not on its way out.
Sourcepub(crate) fn uploads_for(
&self,
target: Target,
) -> impl Iterator<Item = &Upload>
pub(crate) fn uploads_for( &self, target: Target, ) -> impl Iterator<Item = &Upload>
The files on their way that are attached to target.
Sourcefn has_media_server(&mut self) -> Result<(), Task<Action<Message>>>
fn has_media_server(&mut self) -> Result<(), Task<Action<Message>>>
Whether there is a media server to send a file to. Where there is none, the page they are added on is shown, and says why.
Sourcepub fn handle_attach_media(&mut self) -> Task<Action<Message>>
pub fn handle_attach_media(&mut self) -> Task<Action<Message>>
Pick what is to be attached to what is being written, in the desktop’s file chooser. The popup closes meanwhile: it is above every window, the chooser among them, and has the keyboard.
Sourcepub fn handle_media_picked(
&mut self,
picked: Result<Vec<PathBuf>, String>,
) -> Task<Action<Message>>
pub fn handle_media_picked( &mut self, picked: Result<Vec<PathBuf>, String>, ) -> Task<Action<Message>>
The file chooser is done: with these files, with none, or it could not be opened. The popup opens again, on the composer.
Sourcepub fn handle_compose_paste(&self) -> Task<Action<Message>>
pub fn handle_compose_paste(&self) -> Task<Action<Message>>
Ctrl+V was pressed in the composer: see what is on the clipboard.
Sourcepub fn handle_compose_pasted(
&mut self,
pasted: Option<Pasted>,
) -> Task<Action<Message>>
pub fn handle_compose_pasted( &mut self, pasted: Option<Pasted>, ) -> Task<Action<Message>>
What was on the clipboard: text goes into what is written, and files or a picture are attached to it.
Sourcefn attach_pasted(&mut self, picked: Vec<Picked>) -> Task<Action<Message>>
fn attach_pasted(&mut self, picked: Vec<Picked>) -> Task<Action<Message>>
Attach picked, which were pasted, if there is a server to send
them to.
Sourcefn attach_all(&mut self, picked: Vec<Picked>) -> Task<Action<Message>>
fn attach_all(&mut self, picked: Vec<Picked>) -> Task<Action<Message>>
Send each of picked on its way, attached to what is being
written.
Sourcefn say_of_attaching(&mut self, target: Option<Target>, said: String)
fn say_of_attaching(&mut self, target: Option<Target>, said: String)
Say said of attaching something to target: in the composer, if
it is open on that, or on what is open if no target is named; and
over whatever is on show otherwise.
Sourcepub fn handle_media_uploaded(
&mut self,
id: u64,
result: Result<Attachment, AttachFailure>,
) -> Task<Action<Message>>
pub fn handle_media_uploaded( &mut self, id: u64, result: Result<Attachment, AttachFailure>, ) -> Task<Action<Message>>
The file numbered id is on a media server, or isn’t. Its address
goes at the end of what it was attached to: in the composer, if
that is open on it, and in its draft otherwise.
Sourcepub fn handle_cancel_upload(&mut self, id: u64)
pub fn handle_cancel_upload(&mut self, id: u64)
Call off the file numbered id, which is on its way.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn popup_max_height(&self) -> f32
pub(crate) fn popup_max_height(&self) -> f32
How tall the popup may be: as tall as its screen has room.
Sourcepub(crate) fn screen_scale(&self) -> f32
pub(crate) fn screen_scale(&self) -> f32
How many pixels a point is on the screen the popup opens on: what pictures are made for. Until the screen has said, more than on most, so that what is made meanwhile is sharp on any.
Sourcepub(crate) fn measure_screen(&self) -> Task<Action<Message>>
pub(crate) fn measure_screen(&self) -> Task<Action<Message>>
Ask what the screen is like that the popup opens on.
Sourcepub(crate) fn measure_screen_soon(&self) -> Task<Action<Message>>
pub(crate) fn measure_screen_soon(&self) -> Task<Action<Message>>
Ask what the screen is like once the surface that says so has had the time to be laid out: when the window starts.
Sourcepub fn handle_screen_measured(&mut self, screen: Option<Screen>)
pub fn handle_screen_measured(&mut self, screen: Option<Screen>)
What the screen is like was found out, or wasn’t: the last answer stands until there is another.
Sourcepub(crate) fn keep_what_is_copied(&self) -> Task<Action<Message>>
pub(crate) fn keep_what_is_copied(&self) -> Task<Action<Message>>
Open the surface that keeps what is copied, and says what the screen is like: a point wide, down the edge of the screen from top to bottom, under every window, that shows nothing and takes neither the keyboard nor the pointer.
What is copied is the copier’s to hand over when it is pasted, and the toolkit keeps it with the first surface it opened, for as long as that is there. The popup is gone at the next click anywhere else, which is where something copied is on its way to: copied from the popup alone, a link was not there to paste. So a surface is opened before any popup, and stays.
Being there, it is also what is asked how much room the screen
has for the popup, and at what scale it is drawn (see
crate::screen): it is as tall as the compositor makes a
surface that reaches from the top of the screen to the bottom.
Sourcepub fn handle_toggle_popup(&mut self) -> Task<Action<Message>>
pub fn handle_toggle_popup(&mut self) -> Task<Action<Message>>
Handle popup toggle: open it by the panel, or close it.
The popup is a surface of the window’s own on the compositor, not
the panel’s (see crate::button), so it is not the panel that
places it under the button: it is put against the edge the panel
is on, at the end of it the button is nearer (see popup_anchor).
It has the keyboard while it is open, as a popup of the panel’s
has.
Sourcepub fn handle_popup_unfocused(&mut self, id: Id) -> Task<Action<Message>>
pub fn handle_popup_unfocused(&mut self, id: Id) -> Task<Action<Message>>
The popup lost the keyboard, which it has while it is open: something outside it was clicked. It closes, as a popup of the panel’s does, with everything in it kept as it is.
Sourcepub fn handle_escape(&mut self) -> Task<Action<Message>>
pub fn handle_escape(&mut self) -> Task<Action<Message>>
Escape was pressed: put away what was opened last. A menu open over the list, if one is; the popup itself otherwise, as a click outside it would, with everything in it kept as it is.
Sourcepub fn handle_popup_closed(&mut self, id: Id) -> Task<Action<Message>>
pub fn handle_popup_closed(&mut self, id: Id) -> Task<Action<Message>>
Handle popup closed event. What is in the composer is kept: the popup closes whenever something else is clicked, and may not be opened again before the session ends.
Sourcefn popup_left(&mut self) -> Task<Action<Message>>
fn popup_left(&mut self) -> Task<Action<Message>>
The popup closed, either way. What is in the composer is kept; a menu left open is not there to be found when the popup opens again; and a video that played is held where it was.
Sourcepub(crate) fn thread_on_top(&self) -> Option<&ThreadState>
pub(crate) fn thread_on_top(&self) -> Option<&ThreadState>
The thread on show, or under what is: the page opened last, if it is one.
Sourcepub(crate) fn profile_on_top(&self) -> Option<&ProfileState>
pub(crate) fn profile_on_top(&self) -> Option<&ProfileState>
The profile on show, or under what is: the page opened last, if it is one.
Sourcepub(crate) fn bookmarks_on_top(&self) -> Option<&BookmarksPage>
pub(crate) fn bookmarks_on_top(&self) -> Option<&BookmarksPage>
The bookmarks page on show, or under what is: the page opened last, if it is one.
Sourcepub(crate) fn search_on_top(&self) -> Option<&SearchPage>
pub(crate) fn search_on_top(&self) -> Option<&SearchPage>
The search on show, if a search is the page on top.
Sourcepub(crate) fn threads_mut(&mut self) -> impl Iterator<Item = &mut ThreadState>
pub(crate) fn threads_mut(&mut self) -> impl Iterator<Item = &mut ThreadState>
Every open thread, on show or under other pages.
Sourcepub(crate) fn profiles_mut(&mut self) -> impl Iterator<Item = &mut ProfileState>
pub(crate) fn profiles_mut(&mut self) -> impl Iterator<Item = &mut ProfileState>
Every open profile, on show or under other pages.
Sourcepub(crate) fn open_page(&mut self, page: Page) -> Task<Action<Message>>
pub(crate) fn open_page(&mut self, page: Page) -> Task<Action<Message>>
Show page over whatever is on show now, from its top: the scroller
has the place of the list it was opened from.
Sourcepub fn handle_close_page(&mut self) -> Task<Action<Message>>
pub fn handle_close_page(&mut self) -> Task<Action<Message>>
Close the page on show: back to the page it was opened from, or to the feed, where that was left.
Sourcepub fn handle_open_settings(&mut self)
pub fn handle_open_settings(&mut self)
Show the settings, in place of the list on show.
Sourcepub fn handle_open_keys(&mut self)
pub fn handle_open_keys(&mut self)
Show what the keys do, in place of the list on show.
Sourcefn rows_on_show(&mut self) -> (&mut Expanded, &RowHeights<EventId>, f32)
fn rows_on_show(&mut self) -> (&mut Expanded, &RowHeights<EventId>, f32)
What the list of notes on show keeps of its rows: which of its long notes show in full, how tall each row measured, and how far it is scrolled. The list of the page opened last, or else the feed’s.
Sourcepub fn handle_expand_note(&mut self, id: EventId)
pub fn handle_expand_note(&mut self, id: EventId)
Show all the note id says, in its row in the list on show.
Nothing is scrolled: the row grows down from where it is, and
what is under it makes room.
Sourcepub fn handle_collapse_note(&mut self, id: EventId) -> Task<Action<Message>>
pub fn handle_collapse_note(&mut self, id: EventId) -> Task<Action<Message>>
Show the note id cut again, in the row that showed all of it.
A row that shrinks leaves what is in view further down the list, and if its top was above what is in view, the note itself out of sight: the list is scrolled back to the top of the row, so that what its reader sees is the note they folded. With its top in view, nothing moves but what is under it.
Either way the list is told where it is, within what is left of it. Its scroller would otherwise keep a place past its new end, and go there by itself when the list next grew.
Sourcepub(crate) fn show_list_view(&mut self) -> Task<Action<Message>>
pub(crate) fn show_list_view(&mut self) -> Task<Action<Message>>
Show the list that is under whatever was opened over it: the page opened last, or else the feed, each where it was left.
Sourcepub fn handle_open_url(&mut self, url: &str)
pub fn handle_open_url(&mut self, url: &str)
Open a link from a note in the system’s browser, if it is a web
link (see crate::links).
Source§impl AppModel
impl AppModel
Sourcefn account_key(&self) -> Option<PublicKey>
fn account_key(&self) -> Option<PublicKey>
The public key of the account, if somebody is signed in.
Sourcefn seen_key(&self) -> Option<String>
fn seen_key(&self) -> Option<String>
What the settings keep the account’s last look at its
notifications under: its npub.
Sourcepub(crate) fn notifications_seen_at(&self) -> u64
pub(crate) fn notifications_seen_at(&self) -> u64
When the account last looked at its notifications.
Sourcefn mark_notifications_seen(&mut self)
fn mark_notifications_seen(&mut self)
The account has looked at its notifications, as of now.
Sourcepub(crate) fn notifications_tab(&self) -> Tab
pub(crate) fn notifications_tab(&self) -> Tab
Which notifications the page shows: as the control above it says.
Sourcefn notifications_in_view(&self) -> bool
fn notifications_in_view(&self) -> bool
Whether the notifications are being looked at: their page is on show, in an open popup.
Sourcepub(crate) fn watch_notifications(&mut self)
pub(crate) fn watch_notifications(&mut self)
See whether the notifications came into view or went out of it, whatever did that: what was seen before is kept for the visit that begins, and either way everything there is has now been seen. To be called after every message.
Sourcepub(crate) fn unread_notifications(&self) -> usize
pub(crate) fn unread_notifications(&self) -> usize
How many notifications are new: none while they are looked at.
Sourcepub(crate) fn reset_notifications(&mut self)
pub(crate) fn reset_notifications(&mut self)
Forget what the account was told of: the account changed.
Sourcepub(crate) fn load_notifications(&mut self) -> Task<Action<Message>>
pub(crate) fn load_notifications(&mut self) -> Task<Action<Message>>
Find out what the account is told of: from the store now, and from the relays after. Does nothing until both the account and the store are there.
Sourcefn ask_for_notifications(
&mut self,
since: Option<u64>,
until: Option<u64>,
) -> Task<Action<Message>>
fn ask_for_notifications( &mut self, since: Option<u64>, until: Option<u64>, ) -> Task<Action<Message>>
Ask the relays what names the account: what was written after
since and at or before until, where those are given.
Sourcepub(crate) fn check_notifications(&mut self) -> Task<Action<Message>>
pub(crate) fn check_notifications(&mut self) -> Task<Action<Message>>
It is time to ask the relays what is new for the account: what was written since the newest notification known, and a while before it; or the newest there is, if they have not answered yet. Not while they are being asked.
Sourcepub fn handle_notifications_loaded(
&mut self,
account: PublicKey,
source: Source,
older: bool,
result: Result<Notified, FetchError>,
) -> Task<Action<Message>>
pub fn handle_notifications_loaded( &mut self, account: PublicKey, source: Source, older: bool, result: Result<Notified, FetchError>, ) -> Task<Action<Message>>
A page of what the account is told of came from the store or from the relays (or didn’t).
Sourcepub(crate) fn look_up_zapper(&mut self) -> Task<Action<Message>>
pub(crate) fn look_up_zapper(&mut self) -> Task<Action<Message>>
Ask the account’s Lightning address which key its wallet service signs zap receipts with, once, when the account is known to have such an address.
Sourcepub fn handle_zapper_known(
&mut self,
account: PublicKey,
result: Result<Option<PublicKey>, String>,
)
pub fn handle_zapper_known( &mut self, account: PublicKey, result: Result<Option<PublicKey>, String>, )
The account’s Lightning address said which key signs its zap receipts (or could not be asked: it is asked again the next time there is reason to).
Sourcepub fn handle_open_notifications(&mut self) -> Task<Action<Message>>
pub fn handle_open_notifications(&mut self) -> Task<Action<Message>>
Show what the account is told of, over whatever is on show now, and ask the relays whether there is more.
Sourcepub fn handle_load_older_notifications(&mut self) -> Task<Action<Message>>
pub fn handle_load_older_notifications(&mut self) -> Task<Action<Message>>
The list of notifications was scrolled near its end: ask for the page before the oldest, unless that is under way, or there is none.
Sourcepub fn handle_select_notifications_tab(
&mut self,
chosen: Entity,
) -> Task<Action<Message>>
pub fn handle_select_notifications_tab( &mut self, chosen: Entity, ) -> Task<Action<Message>>
Another kind of notification was chosen to show: from its top.
Source§impl AppModel
impl AppModel
Sourcepub fn handle_load_preview(&mut self, url: String) -> Task<Action<Message>>
pub fn handle_load_preview(&mut self, url: String) -> Task<Action<Message>>
A view asked what a page says of itself. Fetch its head, unless that is known or on its way already, or too many others are.
Source§impl AppModel
impl AppModel
Sourcefn profile_on_show(&self, public_key: PublicKey) -> bool
fn profile_on_show(&self, public_key: PublicKey) -> bool
Whether the profile of public_key is the page on show.
Sourcefn profile_is_open(&self, public_key: PublicKey) -> bool
fn profile_is_open(&self, public_key: PublicKey) -> bool
Whether a profile of public_key is open, on show or under other
pages.
Sourcepub fn handle_open_profile(
&mut self,
public_key: PublicKey,
) -> Task<Action<Message>>
pub fn handle_open_profile( &mut self, public_key: PublicKey, ) -> Task<Action<Message>>
Show the profile of public_key, over whatever is on show now.
Sourcepub fn handle_copy_npub(
&mut self,
public_key: PublicKey,
) -> Task<Action<Message>>
pub fn handle_copy_npub( &mut self, public_key: PublicKey, ) -> Task<Action<Message>>
Copy the npub of public_key, whose profile is on show.
Sourcepub(crate) fn check_nip05(&mut self, person: PublicKey) -> Task<Action<Message>>
pub(crate) fn check_nip05(&mut self, person: PublicKey) -> Task<Action<Message>>
Ask the domain in the name person gives as theirs whether it is,
if their profile is open and that name was not asked about yet.
Sourcepub fn handle_nip05_checked(
&mut self,
person: PublicKey,
name: &str,
verified: bool,
)
pub fn handle_nip05_checked( &mut self, person: PublicKey, name: &str, verified: bool, )
The domain in name said whether it is the name of person. If
they gave another name since, this answer is not about it.
Sourcepub fn handle_follow(
&mut self,
person: PublicKey,
follow: bool,
first_list: bool,
) -> Task<Action<Message>>
pub fn handle_follow( &mut self, person: PublicKey, follow: bool, first_list: bool, ) -> Task<Action<Message>>
Follow person (follow), or stop following them. first_list
when the account agreed to a first contact list being written.
Sourcepub fn handle_follow_changed(
&mut self,
account: PublicKey,
person: PublicKey,
result: Result<Vec<PublicKey>, FollowError>,
) -> Task<Action<Message>>
pub fn handle_follow_changed( &mut self, account: PublicKey, person: PublicKey, result: Result<Vec<PublicKey>, FollowError>, ) -> Task<Action<Message>>
The contact list of account was changed for person, or wasn’t.
Changed, the feed starts over with whoever is followed now.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn reset_relays(&mut self)
pub(crate) fn reset_relays(&mut self)
Forget the account’s relays: the account changed, and they were its own, with whatever was changed and not saved.
Sourcepub fn handle_open_relays(&mut self) -> Task<Action<Message>>
pub fn handle_open_relays(&mut self) -> Task<Action<Message>>
Show the account’s relays, in place of the list on show, and ask for its lists again, every one read in full.
Sourcefn ask_what_relays_support(&mut self) -> Task<Action<Message>>
fn ask_what_relays_support(&mut self) -> Task<Action<Message>>
Ask the relays of the sets that ask something of a relay what they say of themselves, while the relays page shows: those on the page that were not asked yet.
Sourcefn ask_relay_use(&self) -> Task<Action<Message>>
fn ask_relay_use(&self) -> Task<Action<Message>>
Ask how the relays this is connected to are doing, for the relays page to say.
Sourcepub(crate) fn load_relay_lists(
&mut self,
open: &[Section],
) -> Task<Action<Message>>
pub(crate) fn load_relay_lists( &mut self, open: &[Section], ) -> Task<Action<Message>>
Find out what the account’s relay lists say, with the private part
of the lists of open read, while the popup is open, and unless
the relays said already and those were read then.
Sourcefn ask_relay_lists(&mut self, source: Source) -> Task<Action<Message>>
fn ask_relay_lists(&mut self, source: Source) -> Task<Action<Message>>
Ask source for the account’s relay lists, unless they are being
changed: what the change leaves is what they are.
Sourcepub fn handle_relay_lists_loaded(
&mut self,
account: PublicKey,
source: Source,
result: Result<RelayLists, FetchError>,
) -> Task<Action<Message>>
pub fn handle_relay_lists_loaded( &mut self, account: PublicKey, source: Source, result: Result<RelayLists, FetchError>, ) -> Task<Action<Message>>
The account’s relay lists came from the store or from the relays, or didn’t. After the store, the relays are asked.
Sourcefn go_by_relay_lists(&self)
fn go_by_relay_lists(&self)
Have the relay client go by what the lists say now: where things are looked up, and which relays are never connected to.
Sourcepub(crate) fn relays_can_change(&self, section: Section) -> bool
pub(crate) fn relays_can_change(&self, section: Section) -> bool
Whether the relays of section can be changed now: by an account
with its key, once the relays have said what its lists are, while
no change is on its way. Not those of a list whose private part
was not read: a list written without it would lose it.
Sourcepub fn handle_add_relay(&mut self, section: Section) -> Task<Action<Message>>
pub fn handle_add_relay(&mut self, section: Section) -> Task<Action<Message>>
Add the relay typed for section to it, on the page: nothing is
written until the relays are saved.
Sourcepub fn handle_remove_relay(&mut self, section: Section, relay: &RelayUrl)
pub fn handle_remove_relay(&mut self, section: Section, relay: &RelayUrl)
Take relay out of section, on the page.
Sourcepub fn handle_shift_relay(
&mut self,
section: Section,
relay: &RelayUrl,
up: bool,
)
pub fn handle_shift_relay( &mut self, section: Section, relay: &RelayUrl, up: bool, )
Move relay a place up section, or down, on the page.
Sourcepub(crate) fn relays_can_save(&self) -> bool
pub(crate) fn relays_can_save(&self) -> bool
Whether there is anything to save, and it can be saved now.
Sourcepub fn handle_save_relays(&mut self) -> Task<Action<Message>>
pub fn handle_save_relays(&mut self) -> Task<Action<Message>>
Write the relays as the page has them to the account’s lists: each list that names others, one after the other.
Sourcepub fn handle_relays_saved(
&mut self,
account: PublicKey,
advertised: Option<Result<Option<Event>, ListError>>,
listed: Vec<(Section, Result<ListedRelays, ListError>)>,
)
pub fn handle_relays_saved( &mut self, account: PublicKey, advertised: Option<Result<Option<Event>, ListError>>, listed: Vec<(Section, Result<ListedRelays, ListError>)>, )
The account’s lists were changed, or weren’t: each is as it came back, and the page shows what they say now. What was not saved stays on the page, changed, to be saved again.
Source§impl AppModel
impl AppModel
Sourcepub fn handle_take_screenshot(&mut self) -> Task<Action<Message>>
pub fn handle_take_screenshot(&mut self) -> Task<Action<Message>>
Ctrl+Shift+S: ask the renderer for what it drew of the popup. Nothing comes of it with the popup closed: there is nothing drawn.
Sourcepub fn handle_screenshot_taken(&mut self, taken: Screenshot)
pub fn handle_screenshot_taken(&mut self, taken: Screenshot)
The renderer handed the picture over: write it to the pictures folder. Encoding a PNG as large as the popup takes a moment, which a thread of its own spends, so that the popup goes on being drawn.
Source§impl AppModel
impl AppModel
Sourcefn search_page_mut(&mut self, id: u64) -> Option<&mut SearchPage>
fn search_page_mut(&mut self, id: u64) -> Option<&mut SearchPage>
The search page id, if that page is still open.
Sourcepub(crate) fn search_relays(&self) -> Option<Vec<RelayUrl>>
pub(crate) fn search_relays(&self) -> Option<Vec<RelayUrl>>
The account’s search relays, as its lists were last read. None
until they were.
Sourcepub fn handle_open_search(&mut self) -> Task<Action<Message>>
pub fn handle_open_search(&mut self) -> Task<Action<Message>>
Show a page to search on, over whatever is on show now, with the place to type in ready to be typed in. The account’s lists are asked for, its search relays read in full, unless they were already: they say which relays search.
Sourcepub fn handle_search_typed(&mut self, id: u64, typed: String)
pub fn handle_search_typed(&mut self, id: u64, typed: String)
What is typed on the search page id changed.
Sourcepub fn handle_search(&mut self, id: u64) -> Task<Action<Message>>
pub fn handle_search(&mut self, id: u64) -> Task<Action<Message>>
Search for what is typed on the search page id; or, if that is
the address of a person or a note, open it.
Sourcepub fn handle_search_named(
&mut self,
id: u64,
name: &str,
person: Option<PublicKey>,
) -> Task<Action<Message>>
pub fn handle_search_named( &mut self, id: u64, name: &str, person: Option<PublicKey>, ) -> Task<Action<Message>>
The domain of name, typed on the search page id, said whose it
is: their profile opens. Or it didn’t, and that is said.
Sourcefn start_search(page: &mut SearchPage) -> u64
fn start_search(page: &mut SearchPage) -> u64
Start the search page id over for another search: what the last
one found goes, and the answers that come are to this one. Returns
which search this is.
Sourcefn show_relay(&mut self, id: u64, relay: RelayUrl) -> Task<Action<Message>>
fn show_relay(&mut self, id: u64, relay: RelayUrl) -> Task<Action<Message>>
Show what relay, whose address was typed on the search page id,
has: the notes it got last, and what it says of itself.
Sourcepub fn handle_relay_info_loaded(
&mut self,
id: u64,
serial: u64,
info: Option<RelayInfo>,
)
pub fn handle_relay_info_loaded( &mut self, id: u64, serial: u64, info: Option<RelayInfo>, )
The relay the search page id shows said what it is, or didn’t.
Sourcefn search_for(&mut self, id: u64, words: String) -> Task<Action<Message>>
fn search_for(&mut self, id: u64, words: String) -> Task<Action<Message>>
Ask the account’s search relays what words find, of people and
of notes, for the search page id. With no search relays there is
nobody to ask, and the page says so.
Sourcepub fn handle_search_show(
&mut self,
id: u64,
what: SearchFor,
) -> Task<Action<Message>>
pub fn handle_search_show( &mut self, id: u64, what: SearchFor, ) -> Task<Action<Message>>
Show the people the search page id found, or the notes, where
that list was left.
Sourcepub fn handle_search_found(
&mut self,
id: u64,
serial: u64,
what: SearchFor,
result: Result<Found, FetchError>,
) -> Task<Action<Message>>
pub fn handle_search_found( &mut self, id: u64, serial: u64, what: SearchFor, result: Result<Found, FetchError>, ) -> Task<Action<Message>>
The search relays answered the search page id, for the search it
numbered serial, with the people or the notes they found; or
didn’t. An answer to a search that another has replaced is dropped.
Source§impl AppModel
impl AppModel
Sourcepub fn handle_set_log_level(&mut self, level: LogLevel)
pub fn handle_set_log_level(&mut self, level: LogLevel)
How much to log was chosen in the settings: keep it, and log that much from now on, without a restart.
Sourcepub fn handle_set_note_text_size(&mut self, size: u16)
pub fn handle_set_note_text_size(&mut self, size: u16)
How large notes are set was chosen in the settings: keep it. The rows are other heights from now on.
Sourcepub fn handle_set_keep_days(&mut self, days: u32) -> Task<Action<Message>>
pub fn handle_set_keep_days(&mut self, days: u32) -> Task<Action<Message>>
How long the event store keeps other people’s notes was chosen in the settings: keep it, and have the store let go now of what is older than that.
Sourcefn forget_row_heights(&mut self)
fn forget_row_heights(&mut self)
Forget how tall the rows of every list measured: they are about to be set in another size, and measure again as they come into view.
Sourcepub fn handle_update_config(&mut self, config: Config) -> Task<Action<Message>>
pub fn handle_update_config(&mut self, config: Config) -> Task<Action<Message>>
The config changed on disk. A new log level is logged at from now
on, unless RUST_LOG says how much to log; notes are set in a new
size; the lists show the notes they are now to show; and the event
store lets go of what is older than it is now to keep.
Source§impl AppModel
impl AppModel
Put a link to the note id on the clipboard (see
share_link), naming the relays it was seen on, and have its
row say so. Nothing is copied of a note that is no longer at hand:
its row is not there to be pressed.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn sweep_store(&mut self) -> Task<Action<Message>>
pub(crate) fn sweep_store(&mut self) -> Task<Action<Message>>
Have the event store let go of what is older than the settings say it keeps, unless it did within the day, or keeps everything, or it isn’t known yet what stays: whose store it is, and what they bookmarked. Called every so often, and when either becomes known.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn note_at_hand(&self, id: EventId) -> Option<Note>
pub(crate) fn note_at_hand(&self, id: EventId) -> Option<Note>
The note id, if it is at hand: in the thread, the profile, the
bookmarks or the search on show, or in the feed.
Sourcefn thread_on_show(&self, focused: EventId) -> bool
fn thread_on_show(&self, focused: EventId) -> bool
Whether the thread of the note focused is the one on show.
Sourcepub fn handle_open_thread(
&mut self,
id: EventId,
whereabouts: Whereabouts,
) -> Task<Action<Message>>
pub fn handle_open_thread( &mut self, id: EventId, whereabouts: Whereabouts, ) -> Task<Action<Message>>
Show the thread of the note id, over whatever is on show now.
whereabouts is where the note may be if the account’s own relays
don’t have it, as whatever named it said.
Sourcepub fn handle_thread_loaded(
&mut self,
focused: EventId,
source: Source,
result: Result<Vec<Note>, FetchError>,
) -> Task<Action<Message>>
pub fn handle_thread_loaded( &mut self, focused: EventId, source: Source, result: Result<Vec<Note>, FetchError>, ) -> Task<Action<Message>>
The conversation around a thread’s note came from the store or from the relays (or didn’t). It goes to every open thread of that note.
Source§impl AppModel
impl AppModel
Sourcepub fn handle_video_press(&mut self, url: String) -> Task<Action<Message>>
pub fn handle_video_press(&mut self, url: String) -> Task<Action<Message>>
The video at url was pressed: play it, or hold it if it plays. A
YouTube video is on its way from here, while yt-dlp is asked what
there is to play of it.
Source§impl AppModel
impl AppModel
Sourcepub fn handle_zap_note(&mut self, id: EventId) -> Task<Action<Message>>
pub fn handle_zap_note(&mut self, id: EventId) -> Task<Action<Message>>
Open the zap view for the note id, which is one on show and whose
author has a Lightning address. A zap of the same note that was left
open comes back as it was.
Sourcepub fn handle_zap_amount_changed(&mut self, amount: &str)
pub fn handle_zap_amount_changed(&mut self, amount: &str)
The amount was typed, or a preset chosen. Only digits are kept.
Sourcepub fn handle_zap_comment_changed(&mut self, comment: &str)
pub fn handle_zap_comment_changed(&mut self, comment: &str)
The comment was typed.
Sourcepub fn handle_request_zap_invoice(&mut self) -> Task<Action<Message>>
pub fn handle_request_zap_invoice(&mut self) -> Task<Action<Message>>
Ask the author’s Lightning address for an invoice of the amount chosen.
Sourcepub fn handle_zap_invoice_ready(
&mut self,
note: EventId,
result: Result<Invoice, ZapError>,
) -> Task<Action<Message>>
pub fn handle_zap_invoice_ready( &mut self, note: EventId, result: Result<Invoice, ZapError>, ) -> Task<Action<Message>>
The invoice for the zap of note came, or didn’t. One that comes
after the view was left, or for another zap, is let go.
Sourcepub fn handle_copy_zap_invoice(&mut self) -> Task<Action<Message>>
pub fn handle_copy_zap_invoice(&mut self) -> Task<Action<Message>>
Copy the invoice on show, for a wallet on this machine.
Sourcepub fn handle_zap_receipt_awaited(
&mut self,
note: EventId,
paid: Option<String>,
) -> Task<Action<Message>>
pub fn handle_zap_receipt_awaited( &mut self, note: EventId, paid: Option<String>, ) -> Task<Action<Message>>
The wait for the receipt of note’s zap ended: with the invoice
that was paid, or with nothing when the time ran out.
Sourcepub fn handle_close_zap(&mut self) -> Task<Action<Message>>
pub fn handle_close_zap(&mut self) -> Task<Action<Message>>
Leave the zap view for what it was opened from. Whatever was being waited for is let go.
Source§impl AppModel
impl AppModel
Sourcefn view_bookmarks_header(&self) -> Element<'_, Message>
fn view_bookmarks_header(&self) -> Element<'_, Message>
The line above the bookmarks: the way back, and what this is.
Sourcefn view_bookmarked_notes<'a>(
&'a self,
page: &'a BookmarksPage,
) -> Element<'a, Message>
fn view_bookmarked_notes<'a>( &'a self, page: &'a BookmarksPage, ) -> Element<'a, Message>
The notes of the bookmarks page page, in the scroller, and under
them what is going on at their end.
Sourcepub fn view_bookmarks<'a>(
&'a self,
page: &'a BookmarksPage,
) -> Element<'a, Message>
pub fn view_bookmarks<'a>( &'a self, page: &'a BookmarksPage, ) -> Element<'a, Message>
Render the bookmarks view, of the page page.
Source§impl AppModel
impl AppModel
Sourcefn view_compose_header(&self, composer: &Composer) -> Element<'_, Message>
fn view_compose_header(&self, composer: &Composer) -> Element<'_, Message>
The line above the composer: the way back, and what is being written.
Sourcefn view_note_in_brief<'a>(&'a self, note: &'a Note) -> Element<'a, Message>
fn view_note_in_brief<'a>(&'a self, note: &'a Note) -> Element<'a, Message>
The note a reply answers or a quote quotes, in brief: who wrote it, when, and how it starts.
Sourcefn view_preview<'a>(&'a self, preview: &'a Preview) -> Element<'a, Message>
fn view_preview<'a>(&'a self, preview: &'a Preview) -> Element<'a, Message>
What is being written as it would show once it is out, where the text is while it is written: who writes it and all it says, as a row of a list would have it, in a frame the size of what it holds, no smaller than the text’s and no taller than the popup has room for, past which it scrolls. With nothing written, it says so.
Sourcepub fn view_compose(&self) -> Element<'_, Message>
pub fn view_compose(&self) -> Element<'_, Message>
Render the composer. With nothing being written there is nothing to show but what is under it.
Source§impl AppModel
impl AppModel
The account’s picture, which leads to its profile.
Sourcepub(crate) fn view_feed_modes(&self) -> Element<'_, Message>
pub(crate) fn view_feed_modes(&self) -> Element<'_, Message>
The choice between the notes that start a conversation and those with the replies among them, for above a list of notes. A segmented control: two choices, one of them always made, and seen at a glance.
Sourcefn view_cog(&self) -> Element<'_, Message>
fn view_cog(&self) -> Element<'_, Message>
The cog above the feed, and the menu that opens under it: the account’s bookmarks, for an account that keeps any, its relays, its media servers, and the settings. A click anywhere else puts the menu away.
Sourcefn view_bell(&self) -> Element<'_, Message>
fn view_bell(&self) -> Element<'_, Message>
The bell above the feed: the way to what the account is told of, with how many of those are new over its corner, when any are. The count is over the bell and takes no room: the line is the same with it and without.
Sourcefn view_feed_header(&self) -> Element<'_, Message>
fn view_feed_header(&self) -> Element<'_, Message>
The line above the feed: writing a note, Refresh and Search on the left; in the middle, which notes it shows; the bell, the cog, with the bookmarks and the settings behind it, and the account’s picture on the right.
The button that offers the notes waiting for the list state, as
it is read now: who wrote the first few, and how many there are.
Pressing it shows them, and goes to the top of the list.
Sourcepub(crate) fn with_new_notes<'a>(
&'a self,
list: Element<'a, Message>,
state: &'a FeedState,
) -> Element<'a, Message>
pub(crate) fn with_new_notes<'a>( &'a self, list: Element<'a, Message>, state: &'a FeedState, ) -> Element<'a, Message>
list, the scroller of the list state, with the button that
offers its new notes over it, at the bottom, when there are any.
Over the list rather than in it: it takes no room, so its coming
and going moves nothing.
Sourcepub(crate) fn view_list_end(
&self,
state: &FeedState,
) -> Option<Element<'_, Message>>
pub(crate) fn view_list_end( &self, state: &FeedState, ) -> Option<Element<'_, Message>>
What is going on at the end of the list state, if anything is:
an older page on its way, nothing older to be had, or a stop after
page upon page with nothing to show, and the way on.
Sourcepub(crate) fn view_notes<'a>(
&'a self,
state: &'a FeedState,
nothing: String,
) -> Element<'a, Message>
pub(crate) fn view_notes<'a>( &'a self, state: &'a FeedState, nothing: String, ) -> Element<'a, Message>
The notes of state that are to show, as a list, and under them
what is going on at the list’s end. With none to show, nothing
says so in their place. For a scroller: the feed’s, a profile’s.
Sourcefn empty_feed_text(&self) -> String
fn empty_feed_text(&self) -> String
What the feed view says in place of notes, when the feed has none to show.
Source§impl AppModel
impl AppModel
Sourcefn view_keys_header(&self) -> Element<'_, Message>
fn view_keys_header(&self) -> Element<'_, Message>
The line above the keys: the way back, and what this is.
Source§impl AppModel
impl AppModel
Sourcepub fn view_login(&self) -> Element<'_, Message>
pub fn view_login(&self) -> Element<'_, Message>
Render the sign-in view: a field for a key or a bunker address.
Source§impl AppModel
impl AppModel
Sourcefn view_media_header(&self) -> Element<'_, Message>
fn view_media_header(&self) -> Element<'_, Message>
The line above the servers: the way back, what this is, and Save.
Sourcefn view_media_servers(&self) -> Element<'_, Message>
fn view_media_servers(&self) -> Element<'_, Message>
The servers, each with what it is for and the ways to move it and to take it out, and a server to add.
Sourcepub fn view_media(&self) -> Element<'_, Message>
pub fn view_media(&self) -> Element<'_, Message>
Render the media servers view.
Source§impl AppModel
impl AppModel
Sourcefn view_notifications_header(&self) -> Element<'_, Message>
fn view_notifications_header(&self) -> Element<'_, Message>
The line above the notifications: the way back, and what this is.
Sourcefn view_notification_tabs(&self) -> Element<'_, Message>
fn view_notification_tabs(&self) -> Element<'_, Message>
The choice of which notifications show, in the middle of its line.
Sourcefn empty_notifications_text(&self, tab: Tab) -> String
fn empty_notifications_text(&self, tab: Tab) -> String
What is said in place of the list when the tab on show has nothing: that it is being looked for, that it could not be, or that there is nothing.
Sourcefn view_notifications_list<'a>(
&'a self,
page: &'a NotificationsPage,
) -> Element<'a, Message>
fn view_notifications_list<'a>( &'a self, page: &'a NotificationsPage, ) -> Element<'a, Message>
The notifications the tab on show has, in the scroller, and under them what is going on at their end.
Sourcepub fn view_notifications<'a>(
&'a self,
page: &'a NotificationsPage,
) -> Element<'a, Message>
pub fn view_notifications<'a>( &'a self, page: &'a NotificationsPage, ) -> Element<'a, Message>
Render the notifications view, of the page page.
Source§impl AppModel
impl AppModel
Sourcepub(crate) fn row_context<'a>(
&'a self,
expanded: &'a Expanded,
marked: Option<EventId>,
) -> RowContext<'a>
pub(crate) fn row_context<'a>( &'a self, expanded: &'a Expanded, marked: Option<EventId>, ) -> RowContext<'a>
What the rows of a list are built with, as things stand now: the
list whose long notes in full are expanded, and in which the
keyboard is at the row marked.
Sourcefn view_page_content(&self) -> Element<'_, Message>
fn view_page_content(&self) -> Element<'_, Message>
Dispatch to the appropriate view based on the current ViewState.
Sourcepub fn view_content(&self) -> Element<'_, Message>
pub fn view_content(&self) -> Element<'_, Message>
Build the full content tree for the popup: the current view, under the error banner if there is something to say.
Sourcepub fn view_popup(&self, _id: Id) -> Element<'_, Message>
pub fn view_popup(&self, _id: Id) -> Element<'_, Message>
Render the main popup window, in the applet popup container, which sizes the popup to its content: within these limits, in place of the container’s own, which are one width and no other. A list longer than the popup may be tall takes what room the limit leaves it, and scrolls.
Source§impl AppModel
impl AppModel
Sourcefn view_profile_header(&self) -> Element<'_, Message>
fn view_profile_header(&self) -> Element<'_, Message>
The line above a profile: the way back, and what this is.
Sourcefn view_profile_key(&self, state: &ProfileState) -> Element<'_, Message>
fn view_profile_key(&self, state: &ProfileState) -> Element<'_, Message>
The key of the profile state, short, with a button that copies it
whole.
Sourcefn view_profile_nip05(
&self,
state: &ProfileState,
) -> Option<Element<'_, Message>>
fn view_profile_nip05( &self, state: &ProfileState, ) -> Option<Element<'_, Message>>
The name at a domain the person of state gives as theirs, if the
domain said it is: a name nobody vouched for is not shown.
Following the person of state, or no longer: for an account that
can publish, on a profile that is not its own, once who it follows
is known. One change at a time.
Sourcefn view_profile_person<'a>(
&'a self,
state: &'a ProfileState,
) -> Element<'a, Message>
fn view_profile_person<'a>( &'a self, state: &'a ProfileState, ) -> Element<'a, Message>
Who the profile state is of: the picture across its top, their
picture, their name and key, following them, and, as far as they
said, something about themselves, their website and where they can
be zapped.
Sourcepub fn view_profile<'a>(
&'a self,
state: &'a ProfileState,
) -> Element<'a, Message>
pub fn view_profile<'a>( &'a self, state: &'a ProfileState, ) -> Element<'a, Message>
Render the profile view, of the profile state.
Source§impl AppModel
impl AppModel
Sourcefn view_relays_header(&self) -> Element<'_, Message>
fn view_relays_header(&self) -> Element<'_, Message>
The line above the relays: the way back, what this is, and Save.
Sourcefn view_relay_use(&self, relay: &RelayUrl) -> Option<Element<'_, Message>>
fn view_relay_use(&self, relay: &RelayUrl) -> Option<Element<'_, Message>>
What is known of how relay is doing, if it is one this is
connected to: under its name, in small print.
Sourcefn view_relay_hindrances(
&self,
section: Section,
relay: &RelayUrl,
) -> Vec<Element<'_, Message>> ⓘ
fn view_relay_hindrances( &self, section: Section, relay: &RelayUrl, ) -> Vec<Element<'_, Message>> ⓘ
What relay says of itself that gets in the way of what
section is for, if it said anything: a line each under its name,
in small print that stands out.
Sourcefn view_relay_section(&self, section: Section) -> Element<'_, Message>
fn view_relay_section(&self, section: Section) -> Element<'_, Message>
One set of relays: what it is for, the relays in it, each with the ways to move it and to take it out, and a relay to add.
Sourcepub fn view_relays(&self) -> Element<'_, Message>
pub fn view_relays(&self) -> Element<'_, Message>
Render the relays view.
Source§impl AppModel
impl AppModel
Sourcefn view_search_header<'a>(
&'a self,
page: &'a SearchPage,
) -> Element<'a, Message>
fn view_search_header<'a>( &'a self, page: &'a SearchPage, ) -> Element<'a, Message>
The line above a search: the way back, where the search is typed, and the button that searches, as Enter does.
Sourcefn view_search_tabs(page: &SearchPage) -> Element<'_, Message>
fn view_search_tabs(page: &SearchPage) -> Element<'_, Message>
The choice between the people found and the notes: the one on show stands out.
Sourcefn view_person(&self, person: &PublicKey) -> Element<'_, Message>
fn view_person(&self, person: &PublicKey) -> Element<'_, Message>
One of the people found: their picture, their name, their key, whether the account follows them, and the start of what they say of themselves. A click opens their profile.
Sourcefn view_people_found<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>
fn view_people_found<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>
The people a search found, the best match first.
Sourcefn view_notes_found<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>
fn view_notes_found<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>
The notes a search found, the best match first.
Sourcefn view_search_body<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>
fn view_search_body<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>
What is under where the search is typed: what was found, or why there is nothing to show.
Sourcefn view_relay_shown<'a>(page: &'a SearchPage) -> Option<Element<'a, Message>>
fn view_relay_shown<'a>(page: &'a SearchPage) -> Option<Element<'a, Message>>
What the relay whose notes are on show says of itself, over them: its address, its name, a line about it, and whether it searches.
Sourcepub fn view_search<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>
pub fn view_search<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>
Render the search view.
Source§impl AppModel
impl AppModel
Sourcefn view_settings_header(&self) -> Element<'_, Message>
fn view_settings_header(&self) -> Element<'_, Message>
The line above the settings: the way back, and what this is.
Sourcefn view_settings_account(&self, account: &Account) -> Element<'_, Message>
fn view_settings_account(&self, account: &Account) -> Element<'_, Message>
Who is signed in, how, and the way out.
Sourcefn view_settings_text_size(&self) -> Element<'_, Message>
fn view_settings_text_size(&self) -> Element<'_, Message>
How large notes are set: the size, a step at a time, and a line set in it, since the notes themselves are behind this view.
Sourcefn view_settings_keeping(&self) -> Element<'_, Message>
fn view_settings_keeping(&self) -> Element<'_, Message>
For how long the event store keeps other people’s notes. A number of days the config file says that is none of the choices shows as none chosen.
Sourcefn view_settings_logging(&self) -> Element<'_, Message>
fn view_settings_logging(&self) -> Element<'_, Message>
How much is logged: an applet has no command line to say so on.
Sourcepub fn view_settings(&self) -> Element<'_, Message>
pub fn view_settings(&self) -> Element<'_, Message>
Render the settings view.
Source§impl AppModel
impl AppModel
Sourcefn view_thread_header(&self, state: &ThreadState) -> Element<'_, Message>
fn view_thread_header(&self, state: &ThreadState) -> Element<'_, Message>
The line above the thread: the way back, what this is, and, for an account that can publish, replying to the note the thread is for.
Sourcefn view_thread_list<'a>(
&'a self,
state: &'a ThreadState,
) -> Element<'a, Message>
fn view_thread_list<'a>( &'a self, state: &'a ThreadState, ) -> Element<'a, Message>
The notes of state, in the scroller.
Sourcepub fn view_thread<'a>(&'a self, state: &'a ThreadState) -> Element<'a, Message>
pub fn view_thread<'a>(&'a self, state: &'a ThreadState) -> Element<'a, Message>
Render the thread view, of the thread state.
Source§impl AppModel
impl AppModel
Sourcefn view_zap_header(&self) -> Element<'_, Message>
fn view_zap_header(&self) -> Element<'_, Message>
The line above the zap view: the way back, and what this is.
Sourcefn view_zap_choice<'a>(
&'a self,
zap: &'a ZapState,
name: String,
) -> Element<'a, Message>
fn view_zap_choice<'a>( &'a self, zap: &'a ZapState, name: String, ) -> Element<'a, Message>
Choosing how much to zap, and what to say with it.
Sourcefn view_zap_invoice<'a>(
&'a self,
invoice: &'a Invoice,
qr: Option<&'a Handle>,
copied: bool,
waiting: bool,
name: String,
) -> Element<'a, Message>
fn view_zap_invoice<'a>( &'a self, invoice: &'a Invoice, qr: Option<&'a Handle>, copied: bool, waiting: bool, name: String, ) -> Element<'a, Message>
The invoice to pay: its QR code, what paying it does, and copying it.
Sourcefn view_zap_paid(&self, sats: u64, name: String) -> Element<'_, Message>
fn view_zap_paid(&self, sats: u64, name: String) -> Element<'_, Message>
The zap went through.
Trait Implementations§
Source§impl Application for AppModel
impl Application for AppModel
Source§const APP_ID: &'static str = APP_ID
const APP_ID: &'static str = APP_ID
Unique identifier in RDNN (reverse domain name notation) format.
Source§fn init(core: Core, _flags: Self::Flags) -> (Self, Task<Action<Self::Message>>)
fn init(core: Core, _flags: Self::Flags) -> (Self, Task<Action<Self::Message>>)
Initializes the application with any given flags and startup commands.
Source§fn on_escape(&mut self) -> Task<Action<Self::Message>>
fn on_escape(&mut self) -> Task<Action<Self::Message>>
Escape, pressed where nothing in the popup had a use for it of its own (an open dropdown has: it closes). libcosmic listens for the key and asks here what it means, which by default is nothing.
Source§fn view(&self) -> Element<'_, Self::Message>
fn view(&self) -> Element<'_, Self::Message>
Nothing: there is no window but the popup. The button that opens it
is in the panel, and another process (see crate::button).
Source§fn view_window(&self, id: Id) -> Element<'_, Self::Message>
fn view_window(&self, id: Id) -> Element<'_, Self::Message>
The popup is drawn using this view method. The surface that keeps what is copied shows nothing.
Source§fn subscription(&self) -> Subscription<Self::Message>
fn subscription(&self) -> Subscription<Self::Message>
Register subscriptions for this application.
Source§fn update(&mut self, message: Self::Message) -> Task<Action<Self::Message>>
fn update(&mut self, message: Self::Message) -> Task<Action<Self::Message>>
Handles messages emitted by the application and its widgets.
This function dispatches messages to the appropriate handler modules:
handlers::navigation- The popup, which view it shows, and the pages opened over the feedhandlers::auth- Signing in and outhandlers::feed- Loading the feed, other lists of notes, and authors’ profileshandlers::thread- Opening a note’s threadhandlers::profile- Opening someone’s profilehandlers::compose- Writing and publishing notes, replies and quoteshandlers::media- The account’s media servers, and attaching files to what is being writtenhandlers::keys- The keyboard, on a list: stepping through it, opening a row, going backhandlers::engagement- What was made of notes, and liking and reposting themhandlers::bookmarks- What the account has bookmarked, and bookmarking a notehandlers::zap- Zapping a note: the invoice, and its receipthandlers::images- Fetching the pictures views ask forhandlers::previews- Asking the pages notes link to what they say of themselveshandlers::video- Playing a video, and finding what there is to play of a YouTube onehandlers::share- Copying a link to a note that anyone can openhandlers::screenshot- Taking a picture of the popup, from the popuphandlers::settings- The settings: how large notes are set, how long they are kept, how much is loggedhandlers::store- Having the event store let go of what is oldhandlers::notifications- What others did that concerns the account
Messages are not logged wholesale: several carry a page of notes, and one carries what is typed in the sign-in field. Handlers log what happened instead.
Source§fn on_close_requested(&self, id: Id) -> Option<Message>
fn on_close_requested(&self, id: Id) -> Option<Message>
§fn context_drawer(&self) -> Option<ContextDrawer<'_, Self::Message>>
fn context_drawer(&self) -> Option<ContextDrawer<'_, Self::Message>>
Some.
Use the [ApplicationExt::set_show_context] function for this to take effect.§fn dialog(
&self,
) -> Option<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
fn dialog( &self, ) -> Option<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
Some.Some.§fn header_start(
&self,
) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
fn header_start( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
§fn header_center(
&self,
) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
fn header_center( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
§fn header_end(
&self,
) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
fn header_end( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
nav_bar::Model].§fn on_app_exit(&mut self) -> Option<Self::Message>
fn on_app_exit(&mut self) -> Option<Self::Message>
fn on_context_drawer(&mut self) -> Task<Action<Self::Message>>
§fn on_search(&mut self) -> Task<Action<Self::Message>>
fn on_search(&mut self) -> Task<Action<Self::Message>>
§fn on_window_resize(&mut self, id: Id, width: f32, height: f32)
fn on_window_resize(&mut self, id: Id, width: f32, height: f32)
§fn system_theme_update(
&mut self,
keys: &[&'static str],
new_theme: &Theme,
) -> Task<Action<Self::Message>>
fn system_theme_update( &mut self, keys: &[&'static str], new_theme: &Theme, ) -> Task<Action<Self::Message>>
§fn system_theme_mode_update(
&mut self,
keys: &[&'static str],
new_theme: &ThemeMode,
) -> Task<Action<Self::Message>>
fn system_theme_mode_update( &mut self, keys: &[&'static str], new_theme: &ThemeMode, ) -> Task<Action<Self::Message>>
Auto Trait Implementations§
impl !Freeze for AppModel
impl !RefUnwindSafe for AppModel
impl !Send for AppModel
impl !Sync for AppModel
impl !UnwindSafe for AppModel
impl Unpin for AppModel
impl UnsafeUnpin for AppModel
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Source§impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
Source§type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
Source§fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
§impl<T> Also for T
impl<T> Also for T
§impl<App> ApplicationExt for Appwhere
App: Application,
impl<App> ApplicationExt for Appwhere
App: Application,
§fn view_main(
&self,
) -> Element<'_, Action<<App as Application>::Message>, Theme, Renderer<Renderer, Renderer>>
fn view_main( &self, ) -> Element<'_, Action<<App as Application>::Message>, Theme, Renderer<Renderer, Renderer>>
Creates the view for the main window.
§fn set_window_title(
&mut self,
title: String,
id: Id,
) -> Task<Action<<App as Application>::Message>>
fn set_window_title( &mut self, title: String, id: Id, ) -> Task<Action<<App as Application>::Message>>
§fn set_show_context(&mut self, show: bool)
fn set_show_context(&mut self, show: bool)
§fn set_header_title(&mut self, title: String)
fn set_header_title(&mut self, title: String)
fn watch_config<T>(&self, id: &'static str) -> Subscription<Update<T>>
fn watch_state<T>(&self, id: &'static str) -> Subscription<Update<T>>
§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.impl<T> MaybeClone for T
impl<T> MaybeDebug for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more