Skip to main content

App

Struct App 

Source
pub struct App {
Show 87 fields pub theme: Theme, pub envelopes: Vec<Envelope>, pub all_envelopes: Vec<Envelope>, pub mailbox_view: MailboxView, pub labels: Vec<Label>, pub screen: Screen, pub mail_list_mode: MailListMode, pub selected_index: usize, pub scroll_offset: usize, pub active_pane: ActivePane, pub should_quit: bool, pub layout_mode: LayoutMode, pub search_bar: SearchBar, pub search_page: SearchPageState, pub command_palette: CommandPalette, pub body_view_state: BodyViewState, pub viewing_envelope: Option<Envelope>, pub viewed_thread: Option<Thread>, pub viewed_thread_messages: Vec<Envelope>, pub thread_selected_index: usize, pub message_scroll_offset: u16, pub last_sync_status: Option<String>, pub visible_height: usize, pub body_cache: HashMap<MessageId, MessageBody>, pub queued_body_fetches: Vec<MessageId>, pub in_flight_body_requests: HashSet<MessageId>, pub pending_thread_fetch: Option<ThreadId>, pub in_flight_thread_fetch: Option<ThreadId>, pub pending_search: Option<(String, SearchMode)>, pub search_active: bool, pub pending_rule_detail: Option<String>, pub pending_rule_history: Option<String>, pub pending_rule_dry_run: Option<String>, pub pending_rule_delete: Option<String>, pub pending_rule_upsert: Option<Value>, pub pending_rule_form_load: Option<String>, pub pending_rule_form_save: bool, pub pending_bug_report: bool, pub pending_log_open: bool, pub pending_diagnostics_details: Option<DiagnosticsPaneKind>, pub pending_account_save: Option<AccountConfigData>, pub pending_account_test: Option<AccountConfigData>, pub pending_account_authorize: Option<(AccountConfigData, bool)>, pub pending_account_set_default: Option<String>, pub sidebar_selected: usize, pub sidebar_section: SidebarSection, pub help_modal_open: bool, pub help_scroll_offset: u16, pub saved_searches: Vec<SavedSearch>, pub subscriptions_page: SubscriptionsPageState, pub rules_page: RulesPageState, pub diagnostics_page: DiagnosticsPageState, pub accounts_page: AccountsPageState, pub active_label: Option<LabelId>, pub pending_label_fetch: Option<LabelId>, pub pending_active_label: Option<LabelId>, pub pending_labels_refresh: bool, pub pending_all_envelopes_refresh: bool, pub pending_subscriptions_refresh: bool, pub pending_status_refresh: bool, pub desired_system_mailbox: Option<String>, pub status_message: Option<String>, pub pending_mutation_count: usize, pub pending_mutation_status: Option<String>, pub pending_mutation_queue: Vec<(Request, MutationEffect)>, pub pending_compose: Option<ComposeAction>, pub pending_send_confirm: Option<PendingSend>, pub pending_bulk_confirm: Option<PendingBulkConfirm>, pub error_modal: Option<ErrorModalState>, pub pending_unsubscribe_confirm: Option<PendingUnsubscribeConfirm>, pub pending_unsubscribe_action: Option<PendingUnsubscribeAction>, pub reader_mode: bool, pub signature_expanded: bool, pub label_picker: LabelPicker, pub compose_picker: ComposePicker, pub attachment_panel: AttachmentPanelState, pub snooze_panel: SnoozePanelState, pub pending_attachment_action: Option<PendingAttachmentAction>, pub selected_set: HashSet<MessageId>, pub visual_mode: bool, pub visual_anchor: Option<usize>, pub pending_export_thread: Option<ThreadId>, pub snooze_config: SnoozeConfig, pub sidebar_system_expanded: bool, pub sidebar_user_expanded: bool, pub sidebar_saved_searches_expanded: bool, pub url_modal: Option<UrlModalState>, /* private fields */
}

Fields§

§theme: Theme§envelopes: Vec<Envelope>§all_envelopes: Vec<Envelope>§mailbox_view: MailboxView§labels: Vec<Label>§screen: Screen§mail_list_mode: MailListMode§selected_index: usize§scroll_offset: usize§active_pane: ActivePane§should_quit: bool§layout_mode: LayoutMode§search_bar: SearchBar§search_page: SearchPageState§command_palette: CommandPalette§body_view_state: BodyViewState§viewing_envelope: Option<Envelope>§viewed_thread: Option<Thread>§viewed_thread_messages: Vec<Envelope>§thread_selected_index: usize§message_scroll_offset: u16§last_sync_status: Option<String>§visible_height: usize§body_cache: HashMap<MessageId, MessageBody>§queued_body_fetches: Vec<MessageId>§in_flight_body_requests: HashSet<MessageId>§pending_thread_fetch: Option<ThreadId>§in_flight_thread_fetch: Option<ThreadId>§pending_search: Option<(String, SearchMode)>§search_active: bool§pending_rule_detail: Option<String>§pending_rule_history: Option<String>§pending_rule_dry_run: Option<String>§pending_rule_delete: Option<String>§pending_rule_upsert: Option<Value>§pending_rule_form_load: Option<String>§pending_rule_form_save: bool§pending_bug_report: bool§pending_log_open: bool§pending_diagnostics_details: Option<DiagnosticsPaneKind>§pending_account_save: Option<AccountConfigData>§pending_account_test: Option<AccountConfigData>§pending_account_authorize: Option<(AccountConfigData, bool)>§pending_account_set_default: Option<String>§sidebar_selected: usize§sidebar_section: SidebarSection§help_modal_open: bool§help_scroll_offset: u16§saved_searches: Vec<SavedSearch>§subscriptions_page: SubscriptionsPageState§rules_page: RulesPageState§diagnostics_page: DiagnosticsPageState§accounts_page: AccountsPageState§active_label: Option<LabelId>§pending_label_fetch: Option<LabelId>§pending_active_label: Option<LabelId>§pending_labels_refresh: bool§pending_all_envelopes_refresh: bool§pending_subscriptions_refresh: bool§pending_status_refresh: bool§desired_system_mailbox: Option<String>§status_message: Option<String>§pending_mutation_count: usize§pending_mutation_status: Option<String>§pending_mutation_queue: Vec<(Request, MutationEffect)>§pending_compose: Option<ComposeAction>§pending_send_confirm: Option<PendingSend>§pending_bulk_confirm: Option<PendingBulkConfirm>§error_modal: Option<ErrorModalState>§pending_unsubscribe_confirm: Option<PendingUnsubscribeConfirm>§pending_unsubscribe_action: Option<PendingUnsubscribeAction>§reader_mode: bool§signature_expanded: bool§label_picker: LabelPicker§compose_picker: ComposePicker§attachment_panel: AttachmentPanelState§snooze_panel: SnoozePanelState§pending_attachment_action: Option<PendingAttachmentAction>§selected_set: HashSet<MessageId>§visual_mode: bool§visual_anchor: Option<usize>§pending_export_thread: Option<ThreadId>§snooze_config: SnoozeConfig§sidebar_system_expanded: bool§sidebar_user_expanded: bool§sidebar_saved_searches_expanded: bool§url_modal: Option<UrlModalState>

Implementations§

Source§

impl App

Source

pub fn tick(&mut self)

Source

pub fn apply(&mut self, action: Action)

Source§

impl App

Source

pub fn draw(&mut self, frame: &mut Frame<'_>)

Source§

impl App

Source

pub fn handle_key(&mut self, key: KeyEvent) -> Option<Action>

Source§

impl App

Source

pub fn new() -> Self

Source

pub fn from_config(config: &MxrConfig) -> Self

Source

pub fn from_render_config(render: &RenderConfig) -> Self

Source

pub fn selected_envelope(&self) -> Option<&Envelope>

Source

pub fn mail_list_rows(&self) -> Vec<MailListRow>

Source

pub fn search_mail_list_rows(&self) -> Vec<MailListRow>

Source

pub fn selected_mail_row(&self) -> Option<MailListRow>

Source

pub fn selected_subscription_entry(&self) -> Option<&SubscriptionEntry>

Source

pub fn focused_thread_envelope(&self) -> Option<&Envelope>

Source

pub fn sidebar_items(&self) -> Vec<SidebarItem>

Source

pub fn selected_sidebar_item(&self) -> Option<SidebarItem>

Source

pub fn selected_search_envelope(&self) -> Option<&Envelope>

Source

pub fn selected_rule(&self) -> Option<&Value>

Source

pub fn selected_account(&self) -> Option<&AccountSummaryData>

Source

pub fn enter_account_setup_onboarding(&mut self)

Source

pub async fn load(&mut self, client: &mut Client) -> Result<(), MxrError>

Source

pub fn apply_status_snapshot( &mut self, uptime_secs: u64, daemon_pid: Option<u32>, accounts: Vec<String>, total_messages: u32, sync_statuses: Vec<AccountSyncStatus>, )

Source

pub fn input_pending(&self) -> bool

Source

pub fn ordered_visible_labels(&self) -> Vec<&Label>

Source

pub fn visible_label_count(&self) -> usize

Number of visible (non-hidden) labels.

Source

pub fn visible_labels(&self) -> Vec<&Label>

Get the visible (filtered) labels.

Source

pub fn mail_list_title(&self) -> String

Compute the mail list title based on active filter/search.

Source

pub fn status_bar_state(&self) -> StatusBarState

Source

pub fn resolve_desired_system_mailbox(&mut self)

Source

pub fn queue_body_window(&mut self)

Queue body prefetch for messages around the current cursor position. Only fetches bodies not already in cache.

Source

pub fn next_background_timeout(&self, fallback: Duration) -> Duration

Source

pub fn resolve_body_success(&mut self, body: MessageBody)

Source

pub fn resolve_body_fetch_error( &mut self, message_id: &MessageId, message: String, )

Source

pub fn current_viewing_body(&self) -> Option<&MessageBody>

Source

pub fn selected_attachment(&self) -> Option<&AttachmentMeta>

Source

pub fn open_attachment_panel(&mut self)

Source

pub fn open_url_modal(&mut self)

Source

pub fn close_attachment_panel(&mut self)

Source

pub fn queue_attachment_action(&mut self, operation: AttachmentOperation)

Source

pub fn resolve_attachment_file(&mut self, file: &AttachmentFile)

Source

pub fn apply_local_label_refs( &mut self, message_ids: &[MessageId], add: &[String], remove: &[String], )

Source

pub fn apply_local_flags(&mut self, message_id: &MessageId, flags: MessageFlags)

Source

pub fn apply_local_flags_many(&mut self, updates: &[(MessageId, MessageFlags)])

Source

pub fn finish_pending_mutation(&mut self)

Source

pub fn show_mutation_failure(&mut self, error: &MxrError)

Source

pub fn refresh_mailbox_after_mutation_failure(&mut self)

Source

pub fn resolve_thread_success( &mut self, thread: Thread, messages: Vec<Envelope>, )

Source

pub fn resolve_thread_fetch_error(&mut self, thread_id: &ThreadId)

Source

pub fn set_subscriptions(&mut self, subscriptions: Vec<SubscriptionSummary>)

Trait Implementations§

Source§

impl Default for App

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl UnwindSafe for App

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
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<T> Chain<T> for T

Source§

fn len(&self) -> usize

The number of items that this chain link consists of.
Source§

fn append_to(self, v: &mut Vec<T>)

Append the elements in this link to the chain.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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