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

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 {})
    }
}

Tuple Fields

0: M::Result

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.