[−][src]Struct cached_path::CacheBuilder
Builder to facilitate creating Cache objects.
Implementations
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 dir(mut self: Self, dir: PathBuf) -> CacheBuilder[src]
Set the cache location. This can be set through the environment
variable RUST_CACHED_PATH_ROOT. Otherwise it will default to a subdirectory
named 'cache' of the default system temp directory.
pub fn client_builder(
mut self: Self,
client_builder: ClientBuilder
) -> CacheBuilder[src]
mut self: Self,
client_builder: ClientBuilder
) -> CacheBuilder
Set the ClientBuilder.
pub fn timeout(mut self: Self, timeout: Duration) -> CacheBuilder[src]
Enable a request timeout.
pub fn connect_timeout(mut self: Self, timeout: Duration) -> CacheBuilder[src]
Enable a timeout for the connect phase of each HTTP request.
pub fn max_retries(mut self: Self, max_retries: u32) -> CacheBuilder[src]
Set maximum number of retries for HTTP requests.
pub fn max_backoff(mut self: Self, max_backoff: u32) -> CacheBuilder[src]
Set the maximum backoff delay in milliseconds for retrying HTTP requests.
pub fn freshness_lifetime(
mut self: Self,
freshness_lifetime: u64
) -> CacheBuilder[src]
mut self: Self,
freshness_lifetime: u64
) -> CacheBuilder
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 fn offline(mut self: Self, offline: bool) -> CacheBuilder[src]
Only use offline functionality.
If set to true, when the cached path of an HTTP resource is requested,
the latest cached version is returned without checking for freshness.
But if no cached versions exist, a
NoCachedVersions error is returned.
pub fn progress_bar(
mut self: Self,
progress_bar: Option<ProgressBar>
) -> CacheBuilder[src]
mut self: Self,
progress_bar: Option<ProgressBar>
) -> CacheBuilder
Set the type of progress bar to use.
The default is Some(ProgressBar::Full).
pub fn build(self) -> Result<Cache, Error>[src]
Build the Cache object.
Trait Implementations
impl Debug for CacheBuilder[src]
impl Default for CacheBuilder[src]
Auto Trait Implementations
impl !RefUnwindSafe for CacheBuilder[src]
impl Send for CacheBuilder[src]
impl Sync for CacheBuilder[src]
impl Unpin for CacheBuilder[src]
impl !UnwindSafe for CacheBuilder[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]
S: Into<Dispatch>,