Expand description
Execute function in arbiter’s thread
Arbiter` actor handles Execute message.
Example
use actix::prelude::*;
struct MyActor {
addr: Addr<Arbiter>,
}
impl Actor for MyActor {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Context<Self>) {
self.addr
.do_send(actix::msgs::Execute::new(|| -> Result<(), ()> {
// do something
// ...
Ok(())
}));
}
}
fn main() {}
Implementations
Trait Implementations
Auto Trait Implementations
impl<I = (), E = ()> !RefUnwindSafe for Execute<I, E>
impl<I, E> Send for Execute<I, E>
impl<I = (), E = ()> !Sync for Execute<I, E>
impl<I, E> Unpin for Execute<I, E>
impl<I = (), E = ()> !UnwindSafe for Execute<I, E>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more