Skip to main content

App

Struct App 

Source
pub struct App {
Show 52 fields pub screen: AppScreen, pub active_panel: Panel, pub view_mode: ViewMode, pub chats: Vec<Chat>, pub selected_chat: usize, pub messages: Vec<Message>, pub input: String, pub input_cursor: usize, pub current_user: Option<User>, pub status_message: String, pub scroll_offset: usize, pub last_refresh: Instant, pub refresh_interval: Duration, pub new_chat_mode: bool, pub new_chat_input: String, pub new_chat_cursor: usize, pub suggestions: Vec<UserSuggestion>, pub selected_suggestion: usize, pub last_search_query: String, pub dialog: DialogMode, pub selected_message: Option<usize>, pub selected_channel_message: Option<usize>, pub selected_reaction: usize, pub my_presence: String, pub presence_map: HashMap<String, String>, pub selected_presence: usize, pub teams: Vec<Team>, pub selected_team: usize, pub channels: Vec<Channel>, pub selected_channel: usize, pub channel_messages: Vec<Message>, pub channel_input: String, pub channel_input_cursor: usize, pub channel_scroll_offset: usize, pub teams_panel: TeamsPanel, pub channels_cache: HashMap<String, Vec<Channel>>, pub channel_message_cache: HashMap<String, Vec<Message>>, pub channel_members: Vec<ChannelMember>, pub show_members: bool, pub channel_permission_denied: bool, pub total_unread: i32, pub known_message_ids: HashSet<String>, pub reply_to_message_id: Option<String>, pub reply_to_preview: String, pub editing_message_id: Option<String>, pub messages_next_link: Option<String>, pub channel_messages_next_link: Option<String>, pub loading_more_messages: bool, pub selected_setting: usize, pub editing_setting: bool, pub setting_input: String, pub setting_input_cursor: usize,
}

Fields§

§screen: AppScreen§active_panel: Panel§view_mode: ViewMode§chats: Vec<Chat>§selected_chat: usize§messages: Vec<Message>§input: String§input_cursor: usize§current_user: Option<User>§status_message: String§scroll_offset: usize§last_refresh: Instant§refresh_interval: Duration§new_chat_mode: bool§new_chat_input: String§new_chat_cursor: usize§suggestions: Vec<UserSuggestion>§selected_suggestion: usize§last_search_query: String§dialog: DialogMode§selected_message: Option<usize>§selected_channel_message: Option<usize>§selected_reaction: usize§my_presence: String§presence_map: HashMap<String, String>§selected_presence: usize§teams: Vec<Team>§selected_team: usize§channels: Vec<Channel>§selected_channel: usize§channel_messages: Vec<Message>§channel_input: String§channel_input_cursor: usize§channel_scroll_offset: usize§teams_panel: TeamsPanel§channels_cache: HashMap<String, Vec<Channel>>§channel_message_cache: HashMap<String, Vec<Message>>§channel_members: Vec<ChannelMember>§show_members: bool§channel_permission_denied: bool§total_unread: i32§known_message_ids: HashSet<String>§reply_to_message_id: Option<String>§reply_to_preview: String§editing_message_id: Option<String>§messages_next_link: Option<String>§channel_messages_next_link: Option<String>§loading_more_messages: bool§selected_setting: usize§editing_setting: bool§setting_input: String§setting_input_cursor: usize

Implementations§

Source§

impl App

Source

pub fn new() -> Self

Source

pub fn current_user_id(&self) -> &str

Source

pub fn selected_chat_id(&self) -> Option<&str>

Source

pub fn selected_chat_name(&self) -> String

Source

pub fn select_next_chat(&mut self)

Source

pub fn select_prev_chat(&mut self)

Source

pub fn next_panel(&mut self)

Source

pub fn prev_panel(&mut self)

Source

pub fn insert_char(&mut self, c: char)

Source

pub fn delete_char(&mut self)

Source

pub fn take_input(&mut self) -> String

Source

pub fn move_cursor_left(&mut self)

Source

pub fn move_cursor_right(&mut self)

Source

pub fn scroll_messages_up(&mut self)

Source

pub fn scroll_messages_down(&mut self)

Source

pub fn should_refresh(&self) -> bool

Source

pub fn mark_refreshed(&mut self)

Source

pub fn enter_new_chat_mode(&mut self)

Source

pub fn exit_new_chat_mode(&mut self)

Source

pub fn new_chat_insert_char(&mut self, c: char)

Source

pub fn new_chat_delete_char(&mut self)

Source

pub fn take_new_chat_input(&mut self) -> String

Source

pub fn select_suggestion(&mut self) -> Option<String>

Source

pub fn suggestion_up(&mut self)

Source

pub fn suggestion_down(&mut self)

Returns true if search should be triggered (input changed and >= 2 chars)

Source

pub fn select_message_up(&mut self)

Source

pub fn select_message_down(&mut self)

Source

pub fn selected_message_id(&self) -> Option<&str>

Source

pub fn select_channel_message_up(&mut self)

Source

pub fn select_channel_message_down(&mut self)

Source

pub fn selected_channel_message_id(&self) -> Option<&str>

Source

pub fn open_reaction_picker(&mut self)

Source

pub fn close_dialog(&mut self)

Source

pub fn show_error(&mut self, title: &str, message: &str, details: &str)

Source

pub fn open_presence_picker(&mut self)

Source

pub fn open_settings(&mut self)

Source

pub fn switch_to_chats(&mut self)

Source

pub fn switch_to_teams(&mut self)

Source

pub fn select_next_team(&mut self)

Source

pub fn select_prev_team(&mut self)

Source

pub fn selected_team_id(&self) -> Option<&str>

Source

pub fn selected_team_name(&self) -> String

Source

pub fn select_next_channel(&mut self)

Source

pub fn select_prev_channel(&mut self)

Source

pub fn selected_channel_id(&self) -> Option<&str>

Source

pub fn selected_channel_name(&self) -> String

Source

pub fn next_teams_panel(&mut self)

Source

pub fn prev_teams_panel(&mut self)

Source

pub fn channel_insert_char(&mut self, c: char)

Source

pub fn channel_delete_char(&mut self)

Source

pub fn take_channel_input(&mut self) -> String

Source

pub fn channel_move_cursor_left(&mut self)

Source

pub fn channel_move_cursor_right(&mut self)

Source

pub fn channel_scroll_up(&mut self)

Source

pub fn channel_scroll_down(&mut self)

Source

pub fn update_total_unread(&mut self)

Source

pub fn detect_new_messages(&mut self) -> bool

Detect new messages and return true if there are new ones (for notification bell)

Source

pub fn toggle_members(&mut self)

Source

pub fn start_reply(&mut self)

Source

pub fn start_channel_reply(&mut self)

Source

pub fn cancel_reply(&mut self)

Source

pub fn is_replying(&self) -> bool

Source

pub fn start_edit(&mut self)

Source

pub fn start_channel_edit(&mut self)

Source

pub fn cancel_edit(&mut self)

Source

pub fn is_editing(&self) -> bool

Source

pub fn is_own_selected_message(&self) -> bool

Returns true if the currently selected message was sent by the current user

Source

pub fn is_own_selected_channel_message(&self) -> bool

Source

pub fn prepend_older_messages(&mut self, older: Vec<Message>)

Source

pub fn prepend_older_channel_messages(&mut self, older: Vec<Message>)

Source

pub fn show_cached_channels_for_selected_team(&mut self)

Show cached channels for the currently selected team (instant, no API call)

Source

pub fn show_cached_messages_for_selected_channel(&mut self)

Show cached messages for the currently selected channel (instant)

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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