Skip to main content

AppModel

Struct AppModel 

Source
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: Core

Application state which is managed by the COSMIC runtime.

§config: Config

Configuration data that persists between application runs.

§popup: Option<Id>

The popup id.

§keeper: Id

The 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: bool

What the button in the panel was last told: whether there is something the account has not looked at.

§view_state: ViewState

Which 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: String

What is typed in the sign-in field. May be a secret key: it is cleared as soon as it has been used.

§login_input_hidden: bool

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: LoginProgress

How far the sign-in under way has got.

§signer: Signer

What signs for the account: its key from the keyring, or its remote signer.

§following: FeedState

The 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: u64

How 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: SingleSelectModel

The 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: NotificationsState

What the account is told of.

§notification_tabs: SingleSelectModel

Which 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: SingleSelectModel

The 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: Drafts

What was written and left unpublished, by what it was written to.

§draft_path: PathBuf

Where 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: bool

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

§repost_menu: Option<RepostMenu>

The repost menu that is open, if one is: repost a note, or quote it.

§reaction_menu: Option<ReactionMenu>

What to react with is on offer, for one note.

§who_menu: Option<WhoMenu>

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.

§share_copied: Option<EventId>

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: BookmarkState

What 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: bool

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

§menu_open: bool

The menu behind the cog above the feed is open.

§relays: RelaysState

The account’s relays, as the relays page has them.

§media: MediaState

The 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: ImageStore

Avatars 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: PreviewStore

What 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: Videos

The video that plays, or did last, in the row of the note that links to it.

§http: Client

The 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

Source

fn handle(&mut self, message: Message) -> Task<Action<Message>>

Do what message asks: the one place every message goes through.

Source§

impl AppModel

Source

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.

Source

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.

Source

pub fn handle_login_input_changed(&mut self, input: SecretInput)

The user edited the sign-in field.

Source

pub fn handle_submit_login(&mut self) -> Task<Action<Message>>

Sign in with what is in the sign-in field.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

pub(crate) fn reset_bookmarks(&mut self)

Forget the bookmarks: the account changed, and they were its own.

Source

fn bookmarking_account(&self) -> Option<PublicKey>

The account that keeps bookmarks: the one signed in, if it has its key.

Source

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.

Source

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.

Source

fn known_bookmarks(&self) -> Option<&Bookmarks>

The bookmarks, if they are known.

Source

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.

Source

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.

Source

fn bookmarked_notes_mut(&mut self, id: u64) -> Option<&mut BookmarkedNotes>

The notes of the bookmarks page id, if that page is still open.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

pub(crate) fn can_publish(&self) -> bool

Whether the account can publish: someone is signed in with a key.

Source

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.

Source

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.

Source

pub fn handle_toggle_compose_preview(&mut self) -> Task<Action<Message>>

Ctrl+P: the other of the two. Nothing, where nothing is being written.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn handle_compose_note(&mut self) -> Task<Action<Message>>

Write a new note.

Source

pub fn handle_compose_reply(&mut self, id: EventId) -> Task<Action<Message>>

Write a reply to the note id, which is one on show.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn handle_close_composer(&mut self) -> Task<Action<Message>>

Leave the composer for the view it was opened from, keeping what was written.

Source

pub fn handle_publish(&mut self) -> Task<Action<Message>>

Sign what is in the composer and send it to the relays.

Source

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.

Source

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

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

pub fn handle_toggle_repost_menu(&mut self, id: EventId)

Show what can be done to pass the note id on, or put it away if it is showing.

Source

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.

Source

pub fn handle_toggle_reaction_menu(&mut self, id: EventId)

Offer what to react to the note id with, or put the offer away if it is showing.

Source

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.

Source

fn emoji_picker_mut(&mut self) -> Option<&mut EmojiPicker>

The emoji picker, if it is open.

Source

pub fn handle_emoji_search_typed(&mut self, typed: String)

What to find an emoji by was typed.

Source

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.

Source

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.

Source

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.

Source

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

Source

pub(crate) fn new_feed(&mut self) -> FeedState

A new, empty list of notes, with an id no list had before.

Source

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.

Source

fn feed_authors(&self, id: u64) -> Option<Vec<PublicKey>>

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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

Source

fn list_on_show(&self, id: u64) -> bool

Whether the list id is what the popup shows, or would if it were open.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn handle_profiles_fetched( &mut self, found: Vec<(PublicKey, Profile)>, ) -> Task<Action<Message>>

Profiles arrived, as they stand now.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn load_contacts(&mut self) -> Task<Action<Message>>

Find out who the account follows: from the store now, from the relays after.

Source

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.

Source

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

Source

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.

Source

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.

Source

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

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn handle_share_marked(&mut self) -> Task<Action<Message>>

y was pressed: copy a link to the note the keyboard is at that anyone can open, as the chain link under it does.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

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.

Source

pub fn handle_show_keys(&mut self) -> Task<Action<Message>>

? was pressed: show what the keys do, in the view that says so.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn handle_add_media_server(&mut self)

Add the server typed, on the page: nothing is written until the servers are saved.

Source

pub fn handle_remove_media_server(&mut self, server: &Url)

Take server out, on the page.

Source

pub fn handle_shift_media_server(&mut self, server: &Url, up: bool)

Move server a place up, or down, on the page.

Source

pub(crate) fn media_can_save(&self) -> bool

Whether there is anything to save, and it can be saved now.

Source

pub fn handle_save_media_servers(&mut self) -> Task<Action<Message>>

Write the servers as the page has them to the account’s list.

Source

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.

Source

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.

Source

pub(crate) fn uploads_for( &self, target: Target, ) -> impl Iterator<Item = &Upload>

The files on their way that are attached to target.

Source

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.

Source

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.

Source

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.

Source

pub fn handle_compose_paste(&self) -> Task<Action<Message>>

Ctrl+V was pressed in the composer: see what is on the clipboard.

Source

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.

Source

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.

Source

fn attach_all(&mut self, picked: Vec<Picked>) -> Task<Action<Message>>

Send each of picked on its way, attached to what is being written.

Source

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.

Source

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.

Source

pub fn handle_cancel_upload(&mut self, id: u64)

Call off the file numbered id, which is on its way.

Source§

impl AppModel

Source

pub(crate) fn popup_max_height(&self) -> f32

How tall the popup may be: as tall as its screen has room.

Source

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.

Source

pub(crate) fn measure_screen(&self) -> Task<Action<Message>>

Ask what the screen is like that the popup opens on.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub(crate) fn search_on_top(&self) -> Option<&SearchPage>

The search on show, if a search is the page on top.

Source

pub(crate) fn threads_mut(&mut self) -> impl Iterator<Item = &mut ThreadState>

Every open thread, on show or under other pages.

Source

pub(crate) fn profiles_mut(&mut self) -> impl Iterator<Item = &mut ProfileState>

Every open profile, on show or under other pages.

Source

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.

Source

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.

Source

pub fn handle_open_settings(&mut self)

Show the settings, in place of the list on show.

Source

pub fn handle_open_keys(&mut self)

Show what the keys do, in place of the list on show.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

fn account_key(&self) -> Option<PublicKey>

The public key of the account, if somebody is signed in.

Source

fn seen_key(&self) -> Option<String>

What the settings keep the account’s last look at its notifications under: its npub.

Source

pub(crate) fn notifications_seen_at(&self) -> u64

When the account last looked at its notifications.

Source

fn mark_notifications_seen(&mut self)

The account has looked at its notifications, as of now.

Source

pub(crate) fn notifications_tab(&self) -> Tab

Which notifications the page shows: as the control above it says.

Source

fn notifications_in_view(&self) -> bool

Whether the notifications are being looked at: their page is on show, in an open popup.

Source

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.

Source

pub(crate) fn unread_notifications(&self) -> usize

How many notifications are new: none while they are looked at.

Source

pub(crate) fn reset_notifications(&mut self)

Forget what the account was told of: the account changed.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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

Source

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.

Source

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.

Source

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

Source

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

pub fn handle_preview_loaded( &mut self, url: String, result: Result<Linked, String>, )

A page answered, or didn’t. Either way the rows that link to it are built again: with its preview, with the offer to play it if it turned out to be a video, or without the room kept for either.

Source§

impl AppModel

Source

fn profile_on_show(&self, public_key: PublicKey) -> bool

Whether the profile of public_key is the page on show.

Source

fn profile_is_open(&self, public_key: PublicKey) -> bool

Whether a profile of public_key is open, on show or under other pages.

Source

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.

Source

pub fn handle_copy_npub( &mut self, public_key: PublicKey, ) -> Task<Action<Message>>

Copy the npub of public_key, whose profile is on show.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

fn ask_relay_use(&self) -> Task<Action<Message>>

Ask how the relays this is connected to are doing, for the relays page to say.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn handle_remove_relay(&mut self, section: Section, relay: &RelayUrl)

Take relay out of section, on the page.

Source

pub fn handle_shift_relay( &mut self, section: Section, relay: &RelayUrl, up: bool, )

Move relay a place up section, or down, on the page.

Source

pub(crate) fn relays_can_save(&self) -> bool

Whether there is anything to save, and it can be saved now.

Source

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.

Source

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

Source

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.

Source

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

Source

fn search_page_mut(&mut self, id: u64) -> Option<&mut SearchPage>

The search page id, if that page is still open.

Source

pub(crate) fn search_relays(&self) -> Option<Vec<RelayUrl>>

The account’s search relays, as its lists were last read. None until they were.

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.

Source

pub fn handle_search_typed(&mut self, id: u64, typed: String)

What is typed on the search page id changed.

Search for what is typed on the search page id; or, if that is the address of a person or a note, open it.

Source

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.

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

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

Source

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

Source

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.

Source

fn thread_on_show(&self, focused: EventId) -> bool

Whether the thread of the note focused is the one on show.

Source

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.

Source

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

Source

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

pub fn handle_video_found( &mut self, url: &str, result: Result<String, FindError>, )

yt-dlp answered for the YouTube video at url: with the address of a stream, which is played, or with why there is none, which is said where the video would have played.

Source§

impl AppModel

Source

pub(crate) fn zapper(&self) -> Zapper

Who a zap sent now would be from.

Source

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.

Source

pub fn handle_zap_amount_changed(&mut self, amount: &str)

The amount was typed, or a preset chosen. Only digits are kept.

Source

pub fn handle_zap_comment_changed(&mut self, comment: &str)

The comment was typed.

Source

pub fn handle_request_zap_invoice(&mut self) -> Task<Action<Message>>

Ask the author’s Lightning address for an invoice of the amount chosen.

Source

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.

Source

pub fn handle_copy_zap_invoice(&mut self) -> Task<Action<Message>>

Copy the invoice on show, for a wallet on this machine.

Source

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.

Source

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

Source

fn view_bookmarks_header(&self) -> Element<'_, Message>

The line above the bookmarks: the way back, and what this is.

Source

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.

Source

pub fn view_bookmarks<'a>( &'a self, page: &'a BookmarksPage, ) -> Element<'a, Message>

Render the bookmarks view, of the page page.

Source§

impl AppModel

Source

fn view_compose_header(&self, composer: &Composer) -> Element<'_, Message>

The line above the composer: the way back, and what is being written.

Source

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.

Source

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.

Source

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

Source

fn view_account_button(&self, account: &Account) -> Element<'_, Message>

The account’s picture, which leads to its profile.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn view_new_notes_button( &self, state: &FeedState, ) -> Option<Element<'_, Message>>

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.

Source

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.

Source

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.

Source

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.

Source

fn empty_feed_text(&self) -> String

What the feed view says in place of notes, when the feed has none to show.

Source

pub fn view_feed(&self) -> Element<'_, Message>

Render the feed view.

Source§

impl AppModel

Source

fn view_keys_header(&self) -> Element<'_, Message>

The line above the keys: the way back, and what this is.

Source

pub fn view_keys(&self) -> Element<'_, Message>

Render the view of what the keys do: those that go about a list and from it, those that do something to the marked note, and those that are not a list’s.

Source§

impl AppModel

Source

pub fn view_login(&self) -> Element<'_, Message>

Render the sign-in view: a field for a key or a bunker address.

Source§

impl AppModel

Source

fn view_media_header(&self) -> Element<'_, Message>

The line above the servers: the way back, what this is, and Save.

Source

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.

Source

pub fn view_media(&self) -> Element<'_, Message>

Render the media servers view.

Source§

impl AppModel

Source

fn view_notifications_header(&self) -> Element<'_, Message>

The line above the notifications: the way back, and what this is.

Source

fn view_notification_tabs(&self) -> Element<'_, Message>

The choice of which notifications show, in the middle of its line.

Source

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.

Source

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.

Source

pub fn view_notifications<'a>( &'a self, page: &'a NotificationsPage, ) -> Element<'a, Message>

Render the notifications view, of the page page.

Source§

impl AppModel

Source

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.

Source

fn view_page_content(&self) -> Element<'_, Message>

Dispatch to the appropriate view based on the current ViewState.

Source

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.

Source

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

Source

fn view_profile_header(&self) -> Element<'_, Message>

The line above a profile: the way back, and what this is.

Source

fn view_profile_key(&self, state: &ProfileState) -> Element<'_, Message>

The key of the profile state, short, with a button that copies it whole.

Source

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.

Source

fn view_follow_button( &self, state: &ProfileState, ) -> Option<Element<'_, Message>>

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.

Source

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.

Source

pub fn view_profile<'a>( &'a self, state: &'a ProfileState, ) -> Element<'a, Message>

Render the profile view, of the profile state.

Source§

impl AppModel

Source

fn view_relays_header(&self) -> Element<'_, Message>

The line above the relays: the way back, what this is, and Save.

Source

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.

Source

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.

Source

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.

Source

pub fn view_relays(&self) -> Element<'_, Message>

Render the relays view.

Source§

impl AppModel

Source

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.

Source

fn view_search_tabs(page: &SearchPage) -> Element<'_, Message>

The choice between the people found and the notes: the one on show stands out.

Source

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.

Source

fn view_people_found<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>

The people a search found, the best match first.

Source

fn view_notes_found<'a>(&'a self, page: &'a SearchPage) -> Element<'a, Message>

The notes a search found, the best match first.

Source

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.

Source

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.

Render the search view.

Source§

impl AppModel

Source

fn view_settings_header(&self) -> Element<'_, Message>

The line above the settings: the way back, and what this is.

Source

fn view_settings_account(&self, account: &Account) -> Element<'_, Message>

Who is signed in, how, and the way out.

Source

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.

Source

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.

Source

fn view_settings_logging(&self) -> Element<'_, Message>

How much is logged: an applet has no command line to say so on.

Source

pub fn view_settings(&self) -> Element<'_, Message>

Render the settings view.

Source§

impl AppModel

Source

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.

Source

fn view_thread_list<'a>( &'a self, state: &'a ThreadState, ) -> Element<'a, Message>

The notes of state, in the scroller.

Source

pub fn view_thread<'a>(&'a self, state: &'a ThreadState) -> Element<'a, Message>

Render the thread view, of the thread state.

Source§

impl AppModel

Source

fn view_zap_header(&self) -> Element<'_, Message>

The line above the zap view: the way back, and what this is.

Source

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.

Source

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.

Source

fn view_zap_paid(&self, sats: u64, name: String) -> Element<'_, Message>

The zap went through.

Source

pub fn view_zap(&self) -> Element<'_, Message>

Render the zap view. With no note being zapped there is nothing to show but what is under it.

Trait Implementations§

Source§

impl Application for AppModel

Source§

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>>)

Initializes the application with any given flags and startup commands.

Source§

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>

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>

The popup is drawn using this view method. The surface that keeps what is copied shows nothing.

Source§

fn subscription(&self) -> Subscription<Self::Message>

Register subscriptions for this application.

Source§

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 feed
  • handlers::auth - Signing in and out
  • handlers::feed - Loading the feed, other lists of notes, and authors’ profiles
  • handlers::thread - Opening a note’s thread
  • handlers::profile - Opening someone’s profile
  • handlers::compose - Writing and publishing notes, replies and quotes
  • handlers::media - The account’s media servers, and attaching files to what is being written
  • handlers::keys - The keyboard, on a list: stepping through it, opening a row, going back
  • handlers::engagement - What was made of notes, and liking and reposting them
  • handlers::bookmarks - What the account has bookmarked, and bookmarking a note
  • handlers::zap - Zapping a note: the invoice, and its receipt
  • handlers::images - Fetching the pictures views ask for
  • handlers::previews - Asking the pages notes link to what they say of themselves
  • handlers::video - Playing a video, and finding what there is to play of a YouTube one
  • handlers::share - Copying a link to a note that anyone can open
  • handlers::screenshot - Taking a picture of the popup, from the popup
  • handlers::settings - The settings: how large notes are set, how long they are kept, how much is logged
  • handlers::store - Having the event store let go of what is old
  • handlers::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§

type Executor = Executor

Default async executor to use with the app.
Source§

type Flags = ()

Argument received [Application::new].
Source§

type Message = Message

Message type specific to our app.
Source§

fn core(&self) -> &Core

Grants access to the COSMIC Core.
Source§

fn core_mut(&mut self) -> &mut Core

Grants access to the COSMIC Core.
Source§

fn on_close_requested(&self, id: Id) -> Option<Message>

Called when a window requests to be closed.
Source§

fn style(&self) -> Option<Style>

Overrides the default style for applications
§

fn context_drawer(&self) -> Option<ContextDrawer<'_, Self::Message>>

Displays a context drawer on the side of the application window when Some. Use the [ApplicationExt::set_show_context] function for this to take effect.
§

fn dialog( &self, ) -> Option<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>

Displays a dialog in the center of the application window when Some.
§

fn footer( &self, ) -> Option<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>

Displays a footer at the bottom of the application window when Some.
§

fn header_start( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>

Attaches elements to the start section of the header.
§

fn header_center( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>

Attaches elements to the center of the header.
§

fn header_end( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>

Attaches elements to the end section of the header.
§

fn nav_bar( &self, ) -> Option<Element<'_, Action<Self::Message>, Theme, Renderer<Renderer, Renderer>>>

Allows overriding the default nav bar widget.
§

fn nav_context_menu(&self) -> Option<Vec<MenuTree<Action<Self::Message>>>>

Shows a context menu for the active nav bar item.
§

fn nav_model(&self) -> Option<&Model<SingleSelect>>

Allows COSMIC to integrate with your application’s [nav_bar::Model].
§

fn on_app_exit(&mut self) -> Option<Self::Message>

Called before closing the application. Returning a message will override closing windows.
§

fn on_context_drawer(&mut self) -> Task<Action<Self::Message>>

§

fn on_nav_select(&mut self, id: Entity) -> Task<Action<Self::Message>>

Called when a navigation item is selected.
§

fn on_nav_context(&mut self, id: Entity) -> Task<Action<Self::Message>>

Called when a context menu is requested for a navigation item.
Called when the search function is requested.
§

fn on_window_resize(&mut self, id: Id, width: f32, height: f32)

Called when a window is resized.
§

fn system_theme_update( &mut self, keys: &[&'static str], new_theme: &Theme, ) -> Task<Action<Self::Message>>

Respond to a system theme change
§

fn system_theme_mode_update( &mut self, keys: &[&'static str], new_theme: &ThemeMode, ) -> Task<Action<Self::Message>>

Respond to a system theme mode change

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where 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) -> D
where M: TransformMatrix<T>,

👎Deprecated since 0.7.7:

replaced by palette::chromatic_adaptation::AdaptIntoUnclamped

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

👎Deprecated since 0.7.7:

replaced by palette::chromatic_adaptation::AdaptIntoUnclamped

Convert the source color to the destination color using the bradford method by default.
Source§

impl<T, C> AdaptIntoUnclamped<T> for C
where T: AdaptFromUnclamped<C>,

Source§

type Scalar = <T as AdaptFromUnclamped<C>>::Scalar

The number type that’s used as the color’s components.
Source§

fn adapt_into_unclamped_with<M>(self) -> T

Adapt a color of type Self into a color of type T, using the custom matrix M. Read more
Source§

fn adapt_into_unclamped(self) -> T
where Bradford: LmsToXyz<Self::Scalar> + XyzToLms<Self::Scalar>,

Adapt a color of type Self into a color of type T, using the Bradford matrix. Read more
§

impl<T> Also for T

§

fn also<F>(self, block: F) -> Self
where F: FnOnce(&mut Self),

Apply a function to this value and return the (possibly) modified value.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<App> ApplicationExt for App
where App: Application,

§

fn view_main( &self, ) -> Element<'_, Action<<App as Application>::Message>, Theme, Renderer<Renderer, Renderer>>

Creates the view for the main window.

§

fn drag(&mut self) -> Task<Action<<App as Application>::Message>>

Initiates a window drag.
§

fn maximize(&mut self) -> Task<Action<<App as Application>::Message>>

Maximizes the window.
§

fn minimize(&mut self) -> Task<Action<<App as Application>::Message>>

Minimizes the window.
§

fn title(&self, id: Id) -> &str

Get the title of a window.
§

fn set_window_title( &mut self, title: String, id: Id, ) -> Task<Action<<App as Application>::Message>>

Set the title of a window.
§

fn set_show_context(&mut self, show: bool)

Set the context drawer visibility.
§

fn set_header_title(&mut self, title: String)

Set the header bar title.
§

fn watch_config<T>(&self, id: &'static str) -> Subscription<Update<T>>
where T: CosmicConfigEntry + Send + Sync + Default + 'static + Clone + PartialEq,

§

fn watch_state<T>(&self, id: &'static str) -> Subscription<Update<T>>
where T: CosmicConfigEntry + Send + Sync + Default + 'static + Clone + PartialEq,

§

impl<T, Res> Apply<Res> for T
where T: ?Sized,

§

fn apply<F>(self, f: F) -> Res
where F: FnOnce(Self) -> Res, Self: Sized,

Apply a function which takes the parameter by value.
§

fn apply_ref<F>(&self, f: F) -> Res
where F: FnOnce(&Self) -> Res,

Apply a function which takes the parameter by reference.
§

fn apply_mut<F>(&mut self, f: F) -> Res
where F: FnOnce(&mut Self) -> Res,

Apply a function which takes the parameter by mutable reference.
Source§

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
§

impl<State, Message> IntoBoot<State, Message> for State

§

fn into_boot(self) -> (State, Task<Message>)

Turns some type into the initial state of some [Application].
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts 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 T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more