Skip to main content

RpcResponder

Struct RpcResponder 

Source
pub struct RpcResponder<'a, Response> { /* private fields */ }
Expand description

A request context’s temporary lease to an RPC Reactor’s state. You want to consume your RpcResponder as quickly as possible.

Implementations§

Source§

impl<'a, Response> RpcResponder<'a, Response>
where Response: Message,

Source

pub fn unary( self, unary_rpc: impl Future<Output = Response>, ) -> impl Future<Output = ()>

Consume the responder by providing a future that will materialize the response to this request.

Source

pub fn stream( self, streaming_rpc: impl Stream<Item = Response>, ) -> impl Future<Output = ()>

Consume the responder by providing a stream that will materialize the response to this request.

Source

pub fn immediate(self, response: Response)

Consume the responder by providing an immediate response.

This is the cheapest, fastest way to respond, but you must only use it when you can get a response without blocking!

Auto Trait Implementations§

§

impl<'a, Response> Freeze for RpcResponder<'a, Response>

§

impl<'a, Response> !RefUnwindSafe for RpcResponder<'a, Response>

§

impl<'a, Response> Send for RpcResponder<'a, Response>
where Response: Send,

§

impl<'a, Response> Sync for RpcResponder<'a, Response>
where Response: Send,

§

impl<'a, Response> Unpin for RpcResponder<'a, Response>

§

impl<'a, Response> UnsafeUnpin for RpcResponder<'a, Response>

§

impl<'a, Response> !UnwindSafe for RpcResponder<'a, Response>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V