pub struct Requester<I: 'static + Interchange> { /* private fields */ }
Expand description

Requesting end of the RPC interchange.

The owner of this end initiates RPC by sending a request. It must then either wait until the responder end responds, upon which it can send a new request again. It does so by periodically checking whether take_response is Some. Or it can attempt to cancel, which the responder may or may not honour. For details, see the cancel method.

Implementations

Current state of the interchange.

Informational only!

The responder may change this state between calls, internally atomics ensure correctness.

Send a request to the responder.

If efficiency is a concern, or requests need multiple steps to construct, use request_mut and `send_request.

If the RPC state is Idle, this always succeeds, else calling is a logic error and the request is returned.

Attempt to cancel a request.

If the responder has not taken the request yet, this succeeds and returns the request.

If the responder has taken the request (is processing), we succeed and return None.

In other cases (Idle or Reponsed) there is nothing to cancel and we fail.

Look for a response. If the responder has sent a response, we return it.

This may be called multiple times.

Look for a response. If the responder has sent a response, we return it.

This may be called only once as it move the state to Idle. If you need copies, clone the request.

If the interchange is idle, may build request into the returned value.

Send a request that was already placed in the interchange using request_mut.

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.