Struct interchange::Responder
source · [−]pub struct Responder<I: 'static + Interchange> { /* private fields */ }
Expand description
Processing end of the RPC interchange.
The owner of this end must eventually reply to any requests made to it. In case there is a cancelation of the request, this must be acknowledged instead.
Implementations
sourceimpl<I: Interchange> Responder<I>
impl<I: Interchange> Responder<I>
sourcepub fn state(&self) -> State
pub fn state(&self) -> State
Current state of the interchange.
Informational only!
The responder may change this state between calls, internally atomics ensure correctness.
sourcepub fn request(&mut self) -> Option<&I::REQUEST>
pub fn request(&mut self) -> Option<&I::REQUEST>
If there is a request waiting, take a reference to it out
This may be called only once as it move the state to BuildingResponse. If you need copies, clone the request.
sourcepub fn take_request(&mut self) -> Option<I::REQUEST>
pub fn take_request(&mut self) -> Option<I::REQUEST>
If there is a request waiting, take a reference to it out
This may be called only once as it move the state to BuildingResponse. If you need copies, clone the request.
pub fn is_canceled(&self) -> bool
pub fn acknowledge_cancel(&self) -> Result<(), ()>
sourceimpl<I: Interchange> Responder<I> where
I::RESPONSE: Default,
impl<I: Interchange> Responder<I> where
I::RESPONSE: Default,
sourcepub fn response_mut(&mut self) -> Option<&mut I::RESPONSE>
pub fn response_mut(&mut self) -> Option<&mut I::RESPONSE>
If there is a request waiting that no longer needs to be accessed, may build response into the returned value.
sourcepub fn send_response(&mut self) -> Result<(), ()>
pub fn send_response(&mut self) -> Result<(), ()>
Send a response that was already placed in the interchange using response_mut
.
Trait Implementations
impl<I: Interchange> Send for Responder<I>
Auto Trait Implementations
impl<I> !RefUnwindSafe for Responder<I>
impl<I> !Sync for Responder<I>
impl<I> Unpin for Responder<I>
impl<I> !UnwindSafe for Responder<I>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more