pub struct CacheClientBuilder { /* private fields */ }Expand description
Builder for a CacheClient. Created by CacheClient::builder.
Implementations§
Source§impl CacheClientBuilder
impl CacheClientBuilder
Sourcepub fn cache(self, range: impl AsRange) -> Self
pub fn cache(self, range: impl AsRange) -> Self
Add a key, range, or prefix whose contents should live in the cache.
Overlapping ranges are allowed but each maintains an independent copy of the overlap.
etcd has no empty key, so cache("") caches no keys, while cache(..) caches every key.
Sourcepub fn cache_prefix(self, prefix: impl AsKey) -> Self
pub fn cache_prefix(self, prefix: impl AsKey) -> Self
Sourcepub fn build_on(self, runtime: &Handle) -> CacheClient
pub fn build_on(self, runtime: &Handle) -> CacheClient
Build the cache client using the provided Tokio runtime handle.
This is equivalent to calling build from within a Tokio runtime, but allows
you to specify the runtime explicitly.
Sourcepub fn build(self) -> CacheClient
pub fn build(self) -> CacheClient
Spawn the coherence task and return the cache handle.
Construction never fails and does not wait for the cache to warm: the returned handle is usable immediately, and reads of a configured range pass through to the server until that range’s initial seed completes in the background. With no configured ranges the cache is a plain passthrough.
§Panics
Panics if called from outside a Tokio runtime, which is required to spawn the background
coherence task. Use build_on to provide a runtime handle explicitly.
Auto Trait Implementations§
impl !RefUnwindSafe for CacheClientBuilder
impl !UnwindSafe for CacheClientBuilder
impl Freeze for CacheClientBuilder
impl Send for CacheClientBuilder
impl Sync for CacheClientBuilder
impl Unpin for CacheClientBuilder
impl UnsafeUnpin for CacheClientBuilder
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request