pub struct RpcClientBuilder { /* private fields */ }Expand description
Tower-first RPC client builder.
Implementations§
Source§impl RpcClientBuilder
impl RpcClientBuilder
Sourcepub fn new(config: RpcClientConfig) -> Self
pub fn new(config: RpcClientConfig) -> Self
Creates a builder from client configuration.
Sourcepub fn config(&self) -> &RpcClientConfig
pub fn config(&self) -> &RpcClientConfig
Returns the builder configuration.
Sourcepub async fn connect(&self) -> Result<Channel, Error>
pub async fn connect(&self) -> Result<Channel, Error>
Connects a tonic channel using the configured endpoint and timeouts.
Sourcepub fn inject_request_context<T>(
&self,
context: &RequestContext,
request: &mut Request<T>,
) -> Result<(), InvalidMetadataValue>
pub fn inject_request_context<T>( &self, context: &RequestContext, request: &mut Request<T>, ) -> Result<(), InvalidMetadataValue>
Injects request context into an outgoing tonic request.
Sourcepub async fn scope_request_id<T>(
&self,
request_id: impl Into<String>,
future: impl Future<Output = T>,
) -> T
pub async fn scope_request_id<T>( &self, request_id: impl Into<String>, future: impl Future<Output = T>, ) -> T
Runs a future with the provided request id available to outgoing RPC calls.
Trait Implementations§
Source§impl Clone for RpcClientBuilder
impl Clone for RpcClientBuilder
Source§fn clone(&self) -> RpcClientBuilder
fn clone(&self) -> RpcClientBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RpcClientBuilder
impl RefUnwindSafe for RpcClientBuilder
impl Send for RpcClientBuilder
impl Sync for RpcClientBuilder
impl Unpin for RpcClientBuilder
impl UnsafeUnpin for RpcClientBuilder
impl UnwindSafe for RpcClientBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request