pub struct CachekitIOBuilder { /* private fields */ }Expand description
Builder for CachekitIO.
Implementations§
Source§impl CachekitIOBuilder
impl CachekitIOBuilder
Sourcepub fn api_url(self, url: impl Into<String>) -> Self
pub fn api_url(self, url: impl Into<String>) -> Self
Override the API base URL (default: https://api.cachekit.io).
Sourcepub fn allow_custom_host(self, allow: bool) -> Self
pub fn allow_custom_host(self, allow: bool) -> Self
Allow non-standard hostnames (e.g. custom proxies). Private IPs are still blocked.
Sourcepub fn metrics_provider(self, provider: MetricsProvider) -> Self
pub fn metrics_provider(self, provider: MetricsProvider) -> Self
Override the source of the X-CacheKit-* telemetry headers.
Not needed for normal use: CacheKitBuilder::build attaches the
client’s own live counters to any backend without one. Set this only
to report numbers from somewhere else; it takes precedence.
Sourcepub fn build(self) -> Result<CachekitIO, CachekitError>
pub fn build(self) -> Result<CachekitIO, CachekitError>
Consume the builder and construct a CachekitIO.
§Errors
Returns an error if:
api_keywas not set.- the resolved URL scheme is not
https. - the URL hostname is not permitted (see
validate_cachekitio_url).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CachekitIOBuilder
impl !UnwindSafe for CachekitIOBuilder
impl Freeze for CachekitIOBuilder
impl Send for CachekitIOBuilder
impl Sync for CachekitIOBuilder
impl Unpin for CachekitIOBuilder
impl UnsafeUnpin for CachekitIOBuilder
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> 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 more