pub struct GrpcStreamBuilder<'a> { /* private fields */ }
Expand description
Builder for GrpcStream
.
Implementations§
Source§impl<'a> GrpcStreamBuilder<'a>
impl<'a> GrpcStreamBuilder<'a>
Sourcepub fn cluster<VALUE: Into<Upstream<'a>>>(self, value: VALUE) -> Self
pub fn cluster<VALUE: Into<Upstream<'a>>>(self, value: VALUE) -> Self
Upstream cluster to send the request to.
Sourcepub fn method<VALUE: Into<&'a str>>(self, value: VALUE) -> Self
pub fn method<VALUE: Into<&'a str>>(self, value: VALUE) -> Self
The GRPC service method to call.
Sourcepub fn initial_metadata<VALUE: Into<Vec<(&'a str, &'a [u8])>>>(
self,
value: VALUE,
) -> Self
pub fn initial_metadata<VALUE: Into<Vec<(&'a str, &'a [u8])>>>( self, value: VALUE, ) -> Self
Initial GRPC metadata to send with the request.
Sourcepub fn metadata<VALUE>(self, item: VALUE) -> Self
pub fn metadata<VALUE>(self, item: VALUE) -> Self
Initial GRPC metadata to send with the request.
Sourcepub fn build(self) -> Result<GrpcStream<'a>, GrpcStreamBuilderError>
pub fn build(self) -> Result<GrpcStream<'a>, GrpcStreamBuilderError>
Source§impl<'a> GrpcStreamBuilder<'a>
impl<'a> GrpcStreamBuilder<'a>
Sourcepub fn on_message<R: RootContext + 'static>(
self,
callback: impl FnMut(&mut R, GrpcStreamHandle, &GrpcStreamMessage) + 'static,
) -> Self
pub fn on_message<R: RootContext + 'static>( self, callback: impl FnMut(&mut R, GrpcStreamHandle, &GrpcStreamMessage) + 'static, ) -> Self
Set a stream message callback
Sourcepub fn on_close<R: RootContext + 'static>(
self,
callback: impl FnOnce(&mut R, &GrpcStreamClose) + 'static,
) -> Self
pub fn on_close<R: RootContext + 'static>( self, callback: impl FnOnce(&mut R, &GrpcStreamClose) + 'static, ) -> Self
Set a stream close callback
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for GrpcStreamBuilder<'a>
impl<'a> !RefUnwindSafe for GrpcStreamBuilder<'a>
impl<'a> !Send for GrpcStreamBuilder<'a>
impl<'a> !Sync for GrpcStreamBuilder<'a>
impl<'a> Unpin for GrpcStreamBuilder<'a>
impl<'a> !UnwindSafe for GrpcStreamBuilder<'a>
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