[][src]Struct cached_path::CacheBuilder

pub struct CacheBuilder { /* fields omitted */ }

Builder to facilitate creating Cache objects.

Methods

impl CacheBuilder[src]

pub fn new() -> CacheBuilder[src]

Construct a new CacheBuilder.

pub fn with_client_builder(client_builder: ClientBuilder) -> CacheBuilder[src]

Construct a new CacheBuilder with a ClientBuilder.

pub fn root(self, root: PathBuf) -> CacheBuilder[src]

Set the root directory.

pub fn client_builder(self, client_builder: ClientBuilder) -> CacheBuilder[src]

Set the ClientBuilder.

pub fn timeout(self, timeout: Duration) -> CacheBuilder[src]

Enable a request timeout.

pub fn connect_timeout(self, timeout: Duration) -> CacheBuilder[src]

Enable a timeout for the connect phase of each HTTP request.

pub fn max_retries(self, max_retries: u32) -> CacheBuilder[src]

Set maximum number of retries for HTTP requests.

pub fn max_backoff(self, max_backoff: u32) -> CacheBuilder[src]

Set the maximum backoff delay in milliseconds for retrying HTTP requests.

pub fn freshness_lifetime(self, freshness_lifetime: u64) -> CacheBuilder[src]

Set the default freshness lifetime, in seconds. The default is None, meaning the ETAG for an external resource will always be checked for a fresher value.

pub async fn build(self) -> Result<Cache, Error>[src]

Build the Cache object.

pub fn build_sync(self) -> Result<Cache, Error>[src]

Build the Cache object syncronously.

Trait Implementations

impl Debug for CacheBuilder[src]

impl Default for CacheBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,