pub struct ImageCacheReader { /* private fields */ }Expand description
Read-only handle for image files. Clone only bumps Arc counters;
clones share the same read pool and may be used from many threads.
Implementations§
Source§impl ImageCacheReader
impl ImageCacheReader
pub fn as_session(config: ImageCacheConfig) -> Result<Self>
pub fn onetime(location: DbLocation) -> Result<Self>
pub fn lookup(&self, path: &Path) -> Result<LookupResult<ImageCacheEntry>>
Sourcepub fn lookup_all(
&self,
paths: &[&Path],
) -> Vec<(PathBuf, Result<LookupResult<ImageCacheEntry>>)>
pub fn lookup_all( &self, paths: &[&Path], ) -> Vec<(PathBuf, Result<LookupResult<ImageCacheEntry>>)>
Batch variant of lookup, parallelized with rayon over the
read pool’s connections.
pub fn check(&self, path: &Path) -> Result<bool>
pub fn list_paths(&self) -> Result<Vec<String>>
pub fn all(&self) -> Result<Vec<Result<ImageCacheEntry>>>
Sourcepub fn summarize_by_dir(&self) -> Result<Vec<DirCacheSummary>>
pub fn summarize_by_dir(&self) -> Result<Vec<DirCacheSummary>>
Group all cached entries by their parent directory and aggregate count, total size, and the newest cached-at timestamp (RFC 004). Cheap: enumerates entry metadata without decoding payloads.
Sourcepub fn all_in_dir(&self, path: &Path) -> Result<Vec<Result<ImageCacheEntry>>>
pub fn all_in_dir(&self, path: &Path) -> Result<Vec<Result<ImageCacheEntry>>>
Return all entries whose file lives directly inside path.
If path is a file rather than a directory (the common call-site
pattern: “find all entries in the same directory as this file”),
its parent directory is used automatically.
Sourcepub fn all_in_dir_and_sub_dirs(
&self,
path: &Path,
) -> Result<Vec<Result<ImageCacheEntry>>>
pub fn all_in_dir_and_sub_dirs( &self, path: &Path, ) -> Result<Vec<Result<ImageCacheEntry>>>
Return all entries whose file lives anywhere under path
(recursively).
If path is a file, its parent directory is used automatically.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageCacheReader
impl RefUnwindSafe for ImageCacheReader
impl Send for ImageCacheReader
impl Sync for ImageCacheReader
impl Unpin for ImageCacheReader
impl UnsafeUnpin for ImageCacheReader
impl UnwindSafe for ImageCacheReader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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