pub struct ClientBuilder { /* private fields */ }
Expand description
A builder for a Client
.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ClientBuilder
.
Sourcepub fn kind(&mut self, kind: ClientKind) -> &mut Self
pub fn kind(&mut self, kind: ClientKind) -> &mut Self
Sets the configured client type.
Sourcepub fn local(url: impl Into<String>) -> Self
pub fn local(url: impl Into<String>) -> Self
Creates a new ClientBuilder
with configured client type ClientKind::Local
and a
server URL url
.
Sourcepub fn remote(url: impl Into<String>) -> Self
pub fn remote(url: impl Into<String>) -> Self
Creates a new ClientBuilder
with configured client type ClientKind::Remote
and a
server URL url
.
Sourcepub fn poll_backoff(&mut self, backoff: ExponentialBackoff) -> &mut Self
pub fn poll_backoff(&mut self, backoff: ExponentialBackoff) -> &mut Self
Configures the exponential backoff used when polling the server for cache entry statuses.
Defaults to [ExponentialBackoff::default
].
Sourcepub fn connection_timeout(&mut self, timeout: Duration) -> &mut Self
pub fn connection_timeout(&mut self, timeout: Duration) -> &mut Self
Sets the timeout for connecting to the server.
Defaults to CONNECTION_TIMEOUT_MS_DEFAULT
.
Sourcepub fn request_timeout(&mut self, timeout: Duration) -> &mut Self
pub fn request_timeout(&mut self, timeout: Duration) -> &mut Self
Sets the timeout for receiving a reply from the server.
Defaults to REQUEST_TIMEOUT_MS_DEFAULT
.
Sourcepub fn runtime_handle(&mut self, handle: Handle) -> &mut Self
pub fn runtime_handle(&mut self, handle: Handle) -> &mut Self
Configures a [Handle
] for making asynchronous gRPC requests.
If no handle is specified, starts a new [tokio::runtime::Runtime
] upon building the
Client
object.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ClientBuilder
impl Debug for ClientBuilder
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§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