[][src]Struct grpc::ServerHandlerContext

pub struct ServerHandlerContext {
    pub ctx: ServerHandlerContext,
    pub metadata: Metadata,
}

An object passed to server handlers.

Fields

ctx: ServerHandlerContextmetadata: Metadata

Methods

impl ServerHandlerContext[src]

pub fn loop_remote(&self) -> Handle[src]

Tokio event loop handle (can be used to spawn a future for example).

pub fn spawn<F>(&self, f: F) where
    F: Future<Output = Result<()>> + Send + 'static, 
[src]

Spawn a future, ignore result.

pub fn spawn_poll_fn<F>(&self, f: F) where
    F: FnMut(&mut Context) -> Poll<Result<()>> + Send + 'static, 
[src]

Spawn a poll_fn future. Function error is ignored.

pub fn pump<Resp, S>(&self, stream: S, dest: ServerResponseSink<Resp>) where
    Resp: Send + 'static,
    S: Stream<Item = Result<Resp>> + Unpin + Send + 'static, 
[src]

Spawn a future which polls stream and sends items to ServerResponseSink.

pub fn pump_future<Resp, F>(
    &self,
    future: F,
    dest: ServerResponseUnarySink<Resp>
) where
    Resp: Send + 'static,
    F: Future<Output = Result<Resp>> + Unpin + Send + 'static, 
[src]

Spawn the provided future in tokio even loop, send result to given sink.

Auto Trait Implementations

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.