pub struct VideoCacheWriter { /* private fields */ }Expand description
Update handle for video files.
- Generates poster thumbnails with ffmpeg (frame at 5 s, falling back to 0 s).
Cloneonly bumpsArccounters.
Implementations§
Source§impl VideoCacheWriter
impl VideoCacheWriter
pub fn as_session(config: VideoCacheConfig) -> Result<Self>
pub fn onetime( location: DbLocation, thumbnail_dir: Option<PathBuf>, ffmpeg_path: Option<PathBuf>, ) -> Result<Self>
pub fn upsert(&self, req: UpsertVideoRequest) -> Result<()>
Sourcepub fn upsert_all(
&self,
reqs: Vec<UpsertVideoRequest>,
) -> Vec<(PathBuf, Result<()>)>
pub fn upsert_all( &self, reqs: Vec<UpsertVideoRequest>, ) -> Vec<(PathBuf, Result<()>)>
Batch variant of upsert. Returns (PathBuf, Result<()>) per
request. Freshness checks and thumbnail extraction run in
parallel; writes are serialized; fresh nothing-new entries are
skipped without a write. Individual errors are stored per
element; other requests continue.
pub fn delete(&self, path: &Path) -> Result<bool>
Sourcepub fn delete_in_dir(&self, dir: &Path) -> Result<usize>
pub fn delete_in_dir(&self, dir: &Path) -> Result<usize>
Remove every cached entry whose file lives directly in dir,
deleting the associated thumbnail file (when recorded) as well.
Non-recursive. Returns the number of entries removed (RFC 004).
pub fn list_paths(&self) -> Result<Vec<String>>
pub fn as_reader(&self) -> VideoCacheReader
pub fn lookup(&self, path: &Path) -> Result<LookupResult<VideoCacheEntry>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VideoCacheWriter
impl RefUnwindSafe for VideoCacheWriter
impl Send for VideoCacheWriter
impl Sync for VideoCacheWriter
impl Unpin for VideoCacheWriter
impl UnsafeUnpin for VideoCacheWriter
impl UnwindSafe for VideoCacheWriter
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