[−][src]Struct tari_service_framework::reply_channel::RequestContext
This is the object received on the Receiver-side of this channel. It's a simple wrapper with some convenience functions used to reply to the request.
Implementations
impl<TReq, TResp> RequestContext<TReq, TResp>
[src]
pub fn new(request: TReq, reply_tx: Sender<TResp>) -> Self
[src]
Create a new RequestContect
pub fn request(&self) -> Option<&TReq>
[src]
Return a reference to the request object. None is returned after take_request has been called.
pub fn take_request(&mut self) -> Option<TReq>
[src]
Take ownership of the request object, if ownership has not already been taken, otherwise None is returned.
pub fn split(self) -> (TReq, Sender<TResp>)
[src]
Consume this object and return it's parts. Namely, the request object and the reply oneshot channel.
pub fn reply(self, resp: TResp) -> Result<(), TResp>
[src]
Sends a reply to the caller
Auto Trait Implementations
impl<TReq, TResp> !RefUnwindSafe for RequestContext<TReq, TResp>
impl<TReq, TResp> Send for RequestContext<TReq, TResp> where
TReq: Send,
TResp: Send,
TReq: Send,
TResp: Send,
impl<TReq, TResp> Sync for RequestContext<TReq, TResp> where
TReq: Sync,
TResp: Send,
TReq: Sync,
TResp: Send,
impl<TReq, TResp> Unpin for RequestContext<TReq, TResp> where
TReq: Unpin,
TReq: Unpin,
impl<TReq, TResp> !UnwindSafe for RequestContext<TReq, TResp>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,