[−][src]Struct grpc::ServerHandlerContext
An object passed to server handlers.
Fields
ctx: ServerHandlerContextmetadata: MetadataMethods
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]
F: Future<Output = Result<()>> + Send + 'static,
Spawn a future, ignore result.
pub fn spawn_poll_fn<F>(&self, f: F) where
F: FnMut(&mut Context) -> Poll<Result<()>> + Send + 'static, [src]
F: FnMut(&mut Context) -> Poll<Result<()>> + Send + 'static,
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]
Resp: Send + 'static,
S: Stream<Item = Result<Resp>> + Unpin + Send + 'static,
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]
&self,
future: F,
dest: ServerResponseUnarySink<Resp>
) where
Resp: Send + 'static,
F: Future<Output = Result<Resp>> + Unpin + Send + 'static,
Spawn the provided future in tokio even loop, send result to given sink.
Auto Trait Implementations
impl !RefUnwindSafe for ServerHandlerContext
impl Send for ServerHandlerContext
impl Sync for ServerHandlerContext
impl Unpin for ServerHandlerContext
impl !UnwindSafe for ServerHandlerContext
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,
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.
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>,