Struct actix::MessageResult[][src]

pub struct MessageResult<M: Message>(pub M::Result);

A helper type that implements the MessageResponse trait.

Examples

use actix::prelude::*;

#[derive(Message)]
#[rtype(result = "Response")]
struct Msg;

struct Response;

struct MyActor;

impl Actor for MyActor {
    type Context = Context<Self>;
}

impl Handler<Msg> for MyActor {
    type Result = MessageResult<Msg>;

    fn handle(&mut self, _: Msg, _: &mut Context<Self>) -> Self::Result {
        MessageResult(Response {})
    }
}

Trait Implementations

impl<A, M> MessageResponse<A, M> for MessageResult<M> where
    A: Actor,
    M: Message
[src]

Auto Trait Implementations

impl<M> RefUnwindSafe for MessageResult<M> where
    <M as Message>::Result: RefUnwindSafe
[src]

impl<M> Send for MessageResult<M> where
    <M as Message>::Result: Send
[src]

impl<M> Sync for MessageResult<M> where
    <M as Message>::Result: Sync
[src]

impl<M> Unpin for MessageResult<M> where
    <M as Message>::Result: Unpin
[src]

impl<M> UnwindSafe for MessageResult<M> where
    <M as Message>::Result: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.