pub struct AppContext<'a, Global, Message, Error>{
pub g: &'a mut Global,
pub focus: Option<Focus>,
/* private fields */
}Expand description
Application context for event handling.
Fields§
§g: &'a mut GlobalGlobal state for the application.
focus: Option<Focus>Can be set to hold a Focus, if needed.
Implementations§
Source§impl<'a, Global, Message, Error> AppContext<'a, Global, Message, Error>
impl<'a, Global, Message, Error> AppContext<'a, Global, Message, Error>
Sourcepub fn add_timer(&self, t: TimerDef) -> TimerHandle
pub fn add_timer(&self, t: TimerDef) -> TimerHandle
Add a timer.
Sourcepub fn remove_timer(&self, tag: TimerHandle)
pub fn remove_timer(&self, tag: TimerHandle)
Remove a timer.
Sourcepub fn replace_timer(&self, h: Option<TimerHandle>, t: TimerDef) -> TimerHandle
pub fn replace_timer(&self, h: Option<TimerHandle>, t: TimerDef) -> TimerHandle
Replace a timer. Remove the old timer and create a new one. If the old timer no longer exists it just creates the new one.
Trait Implementations§
Auto Trait Implementations§
impl<'a, Global, Message, Error> !Freeze for AppContext<'a, Global, Message, Error>
impl<'a, Global, Message, Error> !RefUnwindSafe for AppContext<'a, Global, Message, Error>
impl<'a, Global, Message, Error> !Send for AppContext<'a, Global, Message, Error>
impl<'a, Global, Message, Error> !Sync for AppContext<'a, Global, Message, Error>
impl<'a, Global, Message, Error> Unpin for AppContext<'a, Global, Message, Error>
impl<'a, Global, Message, Error> !UnwindSafe for AppContext<'a, Global, Message, Error>
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