Struct actix::MessageResult[][src]

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

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

Performs the conversion.

Performs the conversion.

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.