pub struct Context<'frame, 'bp, T> { /* private fields */ }Implementations§
Source§impl<'frame, 'bp, T: 'static> Context<'frame, 'bp, T>
impl<'frame, 'bp, T: 'static> Context<'frame, 'bp, T>
pub fn new(inner: AnyComponentContext<'frame, 'bp>) -> Self
Sourcepub fn publish<D: 'static>(&mut self, ident: &str, data: D)
pub fn publish<D: 'static>(&mut self, ident: &str, data: D)
Publish an event
§Panics
This will panic if the shared value is exclusively borrowed at the time of the invocation.
Sourcepub fn attribute(&self, key: &str) -> Option<&ValueKind<'_>>
pub fn attribute(&self, key: &str) -> Option<&ValueKind<'_>>
Get a value from the component attributes
Sourcepub fn emit<M: 'static + Send + Sync>(
&self,
recipient: ComponentId<M>,
value: M,
)
pub fn emit<M: 'static + Send + Sync>( &self, recipient: ComponentId<M>, value: M, )
Send a message to a given component
Methods from Deref<Target = AnyComponentContext<'frame, 'bp>>§
pub fn parent(&self) -> Option<Parent>
pub fn stop_runtime(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl<'frame, 'bp, T> Freeze for Context<'frame, 'bp, T>
impl<'frame, 'bp, T> !RefUnwindSafe for Context<'frame, 'bp, T>
impl<'frame, 'bp, T> !Send for Context<'frame, 'bp, T>
impl<'frame, 'bp, T> !Sync for Context<'frame, 'bp, T>
impl<'frame, 'bp, T> Unpin for Context<'frame, 'bp, T>where
T: Unpin,
impl<'frame, 'bp, T> UnsafeUnpin for Context<'frame, 'bp, T>
impl<'frame, 'bp, T> !UnwindSafe for Context<'frame, 'bp, T>
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