pub struct Context { /* private fields */ }
Implementations§
Source§impl Context
impl Context
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new context. The will be be associated with current thread and can
be retrieved at any point while the instance is in scope by Context::get()
.
Any NativeShell application must have exactly one context active.
pub fn run_loop(&self) -> &RunLoop
pub fn get_attachment<T: Any, F: FnOnce() -> T>(&self, on_init: F) -> Ref<'_, T>
Trait Implementations§
Source§impl GetMessageChannel for Context
impl GetMessageChannel for Context
fn message_channel(&self) -> Ref<'_, MessageChannel>
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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