Struct GrpcCallBuilder

Source
pub struct GrpcCallBuilder<'a> { /* private fields */ }
Expand description

Builder for GrpcCall.

Implementations§

Source§

impl<'a> GrpcCallBuilder<'a>

Source

pub fn upstream<VALUE: Into<Upstream<'a>>>(self, value: VALUE) -> Self

Upstream cluster to send the request to.

Source

pub fn service<VALUE: Into<&'a str>>(self, value: VALUE) -> Self

The GRPC service to call.

Source

pub fn method<VALUE: Into<&'a str>>(self, value: VALUE) -> Self

The GRPC service method to call.

Source

pub fn initial_metadata<VALUE: Into<Vec<(&'a str, &'a [u8])>>>( self, value: VALUE, ) -> Self

Initial GRPC metadata to send with the request.

Source

pub fn metadata<VALUE>(self, item: VALUE) -> Self
where Vec<(&'a str, &'a [u8])>: Default + Extend<VALUE>,

Initial GRPC metadata to send with the request.

Source

pub fn message<VALUE: Into<&'a [u8]>>(self, value: VALUE) -> Self

An optional request body to send with the request.

Source

pub fn timeout<VALUE: Into<Duration>>(self, value: VALUE) -> Self

A timeout on waiting for a response. Default is 10 seconds.

Source

pub fn build(self) -> Result<GrpcCall<'a>, GrpcCallBuilderError>

Builds a new GrpcCall.

§Errors

If a required field has not been initialized.

Source§

impl<'a> GrpcCallBuilder<'a>

Source

pub fn callback<R: RootContext + 'static>( self, callback: impl FnOnce(&mut R, &GrpcCallResponse) + 'static, ) -> Self

Set a response callback

Trait Implementations§

Source§

impl<'a> Default for GrpcCallBuilder<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for GrpcCallBuilder<'a>

§

impl<'a> !RefUnwindSafe for GrpcCallBuilder<'a>

§

impl<'a> !Send for GrpcCallBuilder<'a>

§

impl<'a> !Sync for GrpcCallBuilder<'a>

§

impl<'a> Unpin for GrpcCallBuilder<'a>

§

impl<'a> !UnwindSafe for GrpcCallBuilder<'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.