pub enum PersistentVideoBackend {
Redb(RedbVideoCache),
}Expand description
Enum dispatch for persistent video backends.
All features’ variants are included when their respective feature is enabled.
The active backend is selected at construction time via PersistentBackendKind::resolve.
Variants§
Redb(RedbVideoCache)
Implementations§
Source§impl PersistentVideoBackend
impl PersistentVideoBackend
Sourcepub async fn new(config: &CacheConfig, ttl: Option<u64>) -> Result<Self>
pub async fn new(config: &CacheConfig, ttl: Option<u64>) -> Result<Self>
Creates the persistent video backend for the selected kind.
§Arguments
config- The cache configuration specifying directories, TTLs, and backend settings.ttl- Time-to-live in seconds
§Errors
Returns Error::AmbiguousCacheBackend if kind is None and multiple backends are compiled in.
Returns an error if the selected backend fails to initialize.
Trait Implementations§
Source§impl Debug for PersistentVideoBackend
impl Debug for PersistentVideoBackend
Source§impl VideoBackend for PersistentVideoBackend
Available on persistent_cache only.
impl VideoBackend for PersistentVideoBackend
Available on
persistent_cache only.Source§async fn get(&self, url: &str) -> Result<Option<Video>>
async fn get(&self, url: &str) -> Result<Option<Video>>
Retrieves a video by its URL. Read more
Source§async fn put(&self, url: String, video: Video) -> Result<()>
async fn put(&self, url: String, video: Video) -> Result<()>
Stores a video in the cache. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PersistentVideoBackend
impl !UnwindSafe for PersistentVideoBackend
impl Freeze for PersistentVideoBackend
impl Send for PersistentVideoBackend
impl Sync for PersistentVideoBackend
impl Unpin for PersistentVideoBackend
impl UnsafeUnpin for PersistentVideoBackend
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.