Struct actix::MessageResult
source · [−]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
sourceimpl<A, M> MessageResponse<A, M> for MessageResult<M> where
A: Actor,
M: Message,
impl<A, M> MessageResponse<A, M> for MessageResult<M> where
A: Actor,
M: Message,
Auto Trait Implementations
impl<M> RefUnwindSafe for MessageResult<M> where
<M as Message>::Result: RefUnwindSafe,
impl<M> Send for MessageResult<M> where
<M as Message>::Result: Send,
impl<M> Sync for MessageResult<M> where
<M as Message>::Result: Sync,
impl<M> Unpin for MessageResult<M> where
<M as Message>::Result: Unpin,
impl<M> UnwindSafe for MessageResult<M> where
<M as Message>::Result: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more