pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
pub fn use_state<T: Clone + Send + Sync + 'static>( &self, key: &str, initial: T, ) -> State<T>
pub fn use_scratch<T>(&self, initial: T) -> Scratch<T>
pub fn on_message<F>(&mut self, f: F)
pub fn on_panic<F>(&mut self, f: F)
pub fn on_mount<F>(&mut self, f: F)
pub fn on_unmount<F>(&mut self, f: F)
pub fn spawn<F>(&self, name: &str, setup: F) -> Handle
pub fn send_to(&self, id: u64, msg: Message)
pub fn send_named(&self, name: &str, msg: Message)
pub fn request( &self, id: u64, msg: Message, timeout: Duration, ) -> Option<Message>
pub fn reply(&self, _msg: Message)
pub fn metrics(&self) -> &ActorMetrics
pub fn sleep(&self, duration: Duration)
pub fn poll(&self) -> Option<Message>
pub fn id(&self) -> u64
pub fn name(&self) -> &str
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin 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