pub struct Context<T: Actor> { /* private fields */ }Implementations§
Source§impl<T: Actor> Context<T>
impl<T: Actor> Context<T>
Sourcepub fn myself(&self) -> &Addr<T>
pub fn myself(&self) -> &Addr<T>
Examples found in repository?
examples/request_response.rs (line 33)
27 fn handle(&mut self, msg: MyActorMsg, ctx: &Context<Self>) {
28 match msg {
29 MyActorMsg::Add(a, b) => {
30 self.adder.send(AdderMsg::Add {
31 a,
32 b,
33 respond: ctx.myself().chan(),
34 });
35 }
36
37 MyActorMsg::AddedResult(result) => {
38 println!("Result: {}", result);
39 }
40 }
41 }Auto Trait Implementations§
impl<T> Freeze for Context<T>
impl<T> !RefUnwindSafe for Context<T>
impl<T> Send for Context<T>
impl<T> Sync for Context<T>
impl<T> Unpin for Context<T>
impl<T> !UnwindSafe for Context<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