Enum foyer_storage::Store
source · pub enum Store<K, V>where
K: StorageKey,
V: StorageValue,{
None(NoneStore<K, V>),
Fs(GenericStore<K, V, FsDevice>),
LazyFs(Lazy<K, V, GenericStore<K, V, FsDevice>>),
RuntimeFs(Runtime<K, V, GenericStore<K, V, FsDevice>>),
RuntimeLazyFs(Runtime<K, V, Lazy<K, V, GenericStore<K, V, FsDevice>>>),
}
Variants§
None(NoneStore<K, V>)
Fs(GenericStore<K, V, FsDevice>)
LazyFs(Lazy<K, V, GenericStore<K, V, FsDevice>>)
RuntimeFs(Runtime<K, V, GenericStore<K, V, FsDevice>>)
RuntimeLazyFs(Runtime<K, V, Lazy<K, V, GenericStore<K, V, FsDevice>>>)
Trait Implementations§
source§impl<K, V> Clone for Store<K, V>where
K: StorageKey,
V: StorageValue,
impl<K, V> Clone for Store<K, V>where
K: StorageKey,
V: StorageValue,
source§impl<K, V> Debug for Store<K, V>where
K: StorageKey,
V: StorageValue,
impl<K, V> Debug for Store<K, V>where
K: StorageKey,
V: StorageValue,
source§impl<K, V> Storage<K, V> for Store<K, V>where
K: StorageKey,
V: StorageValue,
impl<K, V> Storage<K, V> for Store<K, V>where
K: StorageKey,
V: StorageValue,
type Config = StoreConfig<K, V>
type Writer = StoreWriter<K, V>
async fn open(config: Self::Config) -> Result<Self>
fn is_ready(&self) -> bool
async fn close(&self) -> Result<()>
fn writer<AK>(&self, key: AK) -> Self::Writer
fn exists<Q>(&self, key: &Q) -> Result<bool>
fn get<Q>( &self, key: &Q ) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + 'static
fn remove<Q>(&self, key: &Q) -> Result<bool>
fn clear(&self) -> Result<()>
Auto Trait Implementations§
impl<K, V> Freeze for Store<K, V>
impl<K, V> !RefUnwindSafe for Store<K, V>
impl<K, V> Send for Store<K, V>
impl<K, V> Sync for Store<K, V>
impl<K, V> Unpin for Store<K, V>
impl<K, V> !UnwindSafe for Store<K, V>
Blanket Implementations§
source§impl<K, V, S> AsyncStorageExt<K, V> for S
impl<K, V, S> AsyncStorageExt<K, V> for S
fn insert_async<AK, AV>(&self, key: AK, value: AV)
fn insert_if_not_exists_async<AK, AV>(&self, key: AK, value: AV)
fn insert_async_with_callback<AK, AV, F, FU>(&self, key: AK, value: AV, f: F)
fn insert_if_not_exists_async_with_callback<AK, AV, F, FU>( &self, key: AK, value: AV, f: F )
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<K, V, S> ForceStorageExt<K, V> for S
impl<K, V, S> ForceStorageExt<K, V> for S
fn insert_force<AK, AV>( &self, key: AK, value: AV ) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
source§fn insert_force_with<AK, AV, F>(
&self,
key: AK,
f: F
) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
fn insert_force_with<AK, AV, F>( &self, key: AK, f: F ) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
First judge if the entry will be admitted with
key
and weight
by admission policies.
Then f
will be called and entry will be inserted. Read moresource§fn insert_force_with_future<AK, AV, F, FU>(
&self,
key: AK,
f: F
) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
fn insert_force_with_future<AK, AV, F, FU>( &self, key: AK, f: F ) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
First judge if the entry will be admitted with
key
and weight
by admission policies.
Then f
will be called to fetch value, and entry will be inserted. Read moresource§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 moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<K, V, S> StorageExt<K, V> for S
impl<K, V, S> StorageExt<K, V> for S
fn insert<AK, AV>( &self, key: AK, value: AV ) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
fn insert_if_not_exists<AK, AV>( &self, key: AK, value: AV ) -> impl Future<Output = Result<bool>> + Send
source§fn insert_with<AK, AV, F>(
&self,
key: AK,
f: F
) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
fn insert_with<AK, AV, F>( &self, key: AK, f: F ) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
First judge if the entry will be admitted with
key
and weight
by admission policies.
Then f
will be called and entry will be inserted. Read moresource§fn insert_with_future<AV, AK, F, FU>(
&self,
key: AK,
f: F
) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
fn insert_with_future<AV, AK, F, FU>( &self, key: AK, f: F ) -> impl Future<Output = Result<Option<CachedEntry<K, V>>>> + Send
First judge if the entry will be admitted with
key
and weight
by admission policies.
Then f
will be called to fetch value, and entry will be inserted.