pub struct App {Show 18 fields
pub canvas: Canvas,
pub cursor: Pos,
pub mode: Mode,
pub should_quit: bool,
pub show_help: bool,
pub help_tab: HelpTab,
pub emoji_picker_open: bool,
pub viewport: Rect,
pub viewport_origin: Pos,
pub selection_anchor: Option<Pos>,
pub swatches: [Option<Swatch>; 5],
pub floating: Option<FloatingSelection>,
pub emoji_picker_state: EmojiPickerState,
pub icon_catalog: Option<IconCatalogData>,
pub swatch_body_hits: [Option<Rect>; 5],
pub swatch_pin_hits: [Option<Rect>; 5],
pub help_tab_hits: Vec<(HelpTab, Rect)>,
pub help_scroll: u16,
/* private fields */
}Fields§
§canvas: Canvas§cursor: Pos§mode: Mode§should_quit: bool§show_help: bool§help_tab: HelpTab§emoji_picker_open: bool§viewport: Rect§viewport_origin: Pos§selection_anchor: Option<Pos>§swatches: [Option<Swatch>; 5]§floating: Option<FloatingSelection>§emoji_picker_state: EmojiPickerState§icon_catalog: Option<IconCatalogData>§swatch_body_hits: [Option<Rect>; 5]§swatch_pin_hits: [Option<Rect>; 5]§help_tab_hits: Vec<(HelpTab, Rect)>§help_scroll: u16Implementations§
Source§impl App
impl App
pub fn new() -> Self
Sourcepub fn new_remote(
client: WebsocketClient,
name: String,
color: RgbColor,
) -> Self
pub fn new_remote( client: WebsocketClient, name: String, color: RgbColor, ) -> Self
Construct an App that talks to a remote dartboard server over ws instead of an in-proc ServerHandle. There is exactly one local user (the connected user); peer presence is tracked from server events.
Drains the server until Welcome is received (my_user_id set). This avoids a race where the first keystroke submits an op before the Welcome snapshot is applied — otherwise Welcome’s pre-join empty snapshot would stomp the user’s first paint.
pub fn users(&self) -> &[LocalUser]
pub fn active_user_index(&self) -> usize
pub fn active_user_color(&self) -> RgbColor
pub fn is_embedded(&self) -> bool
Sourcepub fn peer_count(&self) -> usize
pub fn peer_count(&self) -> usize
Total participants the server is aware of. Embedded: every LocalClient counts (all local users). Remote: our peers + us.
pub fn set_viewport(&mut self, viewport: Rect)
pub fn selection(&self) -> Option<Selection>
pub fn toggle_pin(&mut self, idx: usize)
pub fn clear_swatch(&mut self, idx: usize)
pub fn activate_swatch(&mut self, idx: usize)
pub fn tick(&mut self)
pub fn handle_event(&mut self, event: Event)
pub fn handle_intent(&mut self, intent: AppIntent) -> Vec<HostEffect>
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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