[][src]Function actix_interop::with_ctx

pub fn with_ctx<A, F, R>(f: F) -> R where
    A: Actor + 'static,
    F: FnOnce(&mut A, &mut A::Context) -> R, 

May be called from within a future spawned onto an actor context to gain mutable access to the actor's state and/or context. The future must have been wrapped using interop_actor or interop_actor_boxed.

Nested calls to this function will panic, as only one mutable borrow can be given out at a time.