Struct GrpcStream

Source
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>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.