pub struct ServerHandlerContext {
pub ctx: ServerHandlerContext,
pub metadata: Metadata,
}Expand description
An object passed to server handlers.
Fields§
§ctx: ServerHandlerContext§metadata: MetadataImplementations§
Source§impl ServerHandlerContext
impl ServerHandlerContext
Sourcepub fn loop_remote(&self) -> Handle
pub fn loop_remote(&self) -> Handle
Tokio event loop handle (can be used to spawn a future for example).
Sourcepub fn spawn_poll_fn<F>(&self, f: F)
pub fn spawn_poll_fn<F>(&self, f: F)
Spawn a poll_fn future. Function error is ignored.
Sourcepub fn pump<Resp, S>(&self, stream: S, dest: ServerResponseSink<Resp>)
pub fn pump<Resp, S>(&self, stream: S, dest: ServerResponseSink<Resp>)
Spawn a future which polls stream and sends items to ServerResponseSink.
Sourcepub fn pump_future<Resp, F>(
&self,
future: F,
dest: ServerResponseUnarySink<Resp>,
)
pub fn pump_future<Resp, F>( &self, future: F, dest: ServerResponseUnarySink<Resp>, )
Spawn the provided future in tokio even loop, send result to given sink.
Auto Trait Implementations§
impl Freeze for ServerHandlerContext
impl !RefUnwindSafe for ServerHandlerContext
impl Send for ServerHandlerContext
impl Sync for ServerHandlerContext
impl Unpin for ServerHandlerContext
impl !UnwindSafe for ServerHandlerContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more