[−][src]Struct actix_web::actix::msgs::Execute
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() {}
Methods
impl<I, E> Execute<I, E> where
E: Send + 'static,
I: Send + 'static,
[src]
E: Send + 'static,
I: Send + 'static,
pub fn new<F>(f: F) -> Execute<I, E> where
F: FnOnce() -> Result<I, E> + Send + 'static,
[src]
F: FnOnce() -> Result<I, E> + Send + 'static,
pub fn exec(self) -> Result<I, E>
[src]
Execute enclosed function
Trait Implementations
impl<I, E> Message for Execute<I, E> where
E: Send,
I: Send,
[src]
E: Send,
I: Send,
Execute message response
type Result = Result<I, E>
The type of value that this message will resolved with if it is successful. Read more
impl<I, E> Handler<Execute<I, E>> for Arbiter where
E: Send,
I: Send,
[src]
E: Send,
I: Send,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.