pub struct VideoCacheReader { /* private fields */ }Expand description
Read-only handle for video files. Clone only bumps Arc counters;
clones share the same read pool and may be used from many threads.
Implementations§
Source§impl VideoCacheReader
impl VideoCacheReader
pub fn as_session(config: VideoCacheConfig) -> Result<Self>
pub fn onetime(location: DbLocation) -> Result<Self>
pub fn lookup(&self, path: &Path) -> Result<LookupResult<VideoCacheEntry>>
Sourcepub fn lookup_all(
&self,
paths: &[&Path],
) -> Vec<(PathBuf, Result<LookupResult<VideoCacheEntry>>)>
pub fn lookup_all( &self, paths: &[&Path], ) -> Vec<(PathBuf, Result<LookupResult<VideoCacheEntry>>)>
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<VideoCacheEntry>>>
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).
pub fn all_in_dir(&self, path: &Path) -> Result<Vec<Result<VideoCacheEntry>>>
pub fn all_in_dir_and_sub_dirs( &self, path: &Path, ) -> Result<Vec<Result<VideoCacheEntry>>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VideoCacheReader
impl RefUnwindSafe for VideoCacheReader
impl Send for VideoCacheReader
impl Sync for VideoCacheReader
impl Unpin for VideoCacheReader
impl UnsafeUnpin for VideoCacheReader
impl UnwindSafe for VideoCacheReader
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
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> ⓘ
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