[][src]Struct messages::request::Request

pub struct Request<Input, Output> { /* fields omitted */ }

Request structure represents a message which expects a response. Initializing a Request will return two objects:

  • A request itself, which has to be sent to the Mailbox;
  • A oneshot receiver channel to await for the response.

Implementations

impl<Input, Output> Request<Input, Output>[src]

pub fn new(message: Input) -> (Self, Receiver<Output>)[src]

Initializes a new request, returning a Request object and a receiver channel to await for the response.

pub fn message(&self) -> &Input[src]

Returns a reference to the message held in the request.

pub fn respond(self, output: Output) -> Result<(), SendError>[src]

Sends a response to the request initiator.

pub fn into_inner(self) -> (Input, Sender<Output>)[src]

Destructs the request object, returning the request message and the sender channel.

Trait Implementations

impl<Input: Debug, Output: Debug> Debug for Request<Input, Output>[src]

Auto Trait Implementations

impl<Input, Output> !RefUnwindSafe for Request<Input, Output>

impl<Input, Output> Send for Request<Input, Output> where
    Input: Send,
    Output: Send

impl<Input, Output> Sync for Request<Input, Output> where
    Input: Sync,
    Output: Send

impl<Input, Output> Unpin for Request<Input, Output> where
    Input: Unpin

impl<Input, Output> !UnwindSafe for Request<Input, Output>

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.