Struct cache::persistent::client::ClientBuilder
source · 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 !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
§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