pub struct AudibleCache { /* private fields */ }Expand description
Filesystem cache for Audible metadata
Implementations§
Source§impl AudibleCache
impl AudibleCache
Sourcepub fn with_ttl_hours(hours: u64) -> Result<Self>
pub fn with_ttl_hours(hours: u64) -> Result<Self>
Create a new cache with TTL from config (in hours)
Sourcepub async fn get(&self, asin: &str) -> Option<AudibleMetadata>
pub async fn get(&self, asin: &str) -> Option<AudibleMetadata>
Get cached metadata for an ASIN
Sourcepub async fn set(&self, asin: &str, metadata: &AudibleMetadata) -> Result<()>
pub async fn set(&self, asin: &str, metadata: &AudibleMetadata) -> Result<()>
Store metadata in cache for an ASIN
Sourcepub fn stats(&self) -> Result<CacheStats>
pub fn stats(&self) -> Result<CacheStats>
Get cache statistics (number of files, total size)
Auto Trait Implementations§
impl Freeze for AudibleCache
impl RefUnwindSafe for AudibleCache
impl Send for AudibleCache
impl Sync for AudibleCache
impl Unpin for AudibleCache
impl UnwindSafe for AudibleCache
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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