pub struct GrpcStream<'a> {
pub cluster: Upstream<'a>,
pub service: &'a str,
pub method: &'a str,
pub initial_metadata: Vec<(&'a str, &'a [u8])>,
pub on_message: Option<Box<dyn FnMut(&mut DowncastBox<dyn RootContext>, GrpcStreamHandle, &GrpcStreamMessage)>>,
pub on_close: Option<Box<dyn FnOnce(&mut DowncastBox<dyn RootContext>, &GrpcStreamClose)>>,
}
Expand description
Outbound GRPC stream (bidirectional)
Fields§
§cluster: Upstream<'a>
Upstream cluster to send the request to.
service: &'a str
The GRPC service to call.
method: &'a str
The GRPC service method to call.
initial_metadata: Vec<(&'a str, &'a [u8])>
Initial GRPC metadata to send with the request.
on_message: Option<Box<dyn FnMut(&mut DowncastBox<dyn RootContext>, GrpcStreamHandle, &GrpcStreamMessage)>>
Callback to call when the server sends a stream message.
on_close: Option<Box<dyn FnOnce(&mut DowncastBox<dyn RootContext>, &GrpcStreamClose)>>
Callback to call when the stream closes.
Implementations§
Source§impl<'a> GrpcStream<'a>
impl<'a> GrpcStream<'a>
Sourcepub fn open(self) -> Result<GrpcStreamHandle, Status>
pub fn open(self) -> Result<GrpcStreamHandle, Status>
Open a new outbound GRPC stream.
Auto Trait Implementations§
impl<'a> Freeze for GrpcStream<'a>
impl<'a> !RefUnwindSafe for GrpcStream<'a>
impl<'a> !Send for GrpcStream<'a>
impl<'a> !Sync for GrpcStream<'a>
impl<'a> Unpin for GrpcStream<'a>
impl<'a> !UnwindSafe for GrpcStream<'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