Struct proxy_sdk::GrpcStreamBuilder
source · 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> !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