pub struct MemoryStore<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> { /* private fields */ }Expand description
A non-persistent, in-memory Willow store implementation.
Implementations§
Trait Implementations§
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Clone for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Clone for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Debug, S: Debug, PD: Debug, AT: Debug> Debug for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Debug, S: Debug, PD: Debug, AT: Debug> Debug for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Store<MCL, MCC, MPL, N, S, PD, AT> for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Store<MCL, MCC, MPL, N, S, PD, AT> for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
Source§async fn flush(&mut self) -> Result<(), Self::InternalError>
async fn flush(&mut self) -> Result<(), Self::InternalError>
A no-op, because the store is not persistent.
Source§type InternalError = Infallible
type InternalError = Infallible
The type of errors the store implementation might yield on any operation.
Source§async fn create_entry<Data, P, H>(
&mut self,
data: &Data,
payload_producer: P,
payload_length: u64,
ingredients: &AT::Ingredients,
) -> Result<Option<AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>>, CreateEntryError<Self::InternalError, P::Error, AT::CreationError>>where
Data: ?Sized + Namespaced<N> + Coordinatelike<MCL, MCC, MPL, S>,
P: BulkProducer<Item = u8, Final = ()>,
H: Default + Hasher<PD>,
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD> + Debug,
N: Debug,
S: Debug,
PD: Debug,
async fn create_entry<Data, P, H>(
&mut self,
data: &Data,
payload_producer: P,
payload_length: u64,
ingredients: &AT::Ingredients,
) -> Result<Option<AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>>, CreateEntryError<Self::InternalError, P::Error, AT::CreationError>>where
Data: ?Sized + Namespaced<N> + Coordinatelike<MCL, MCC, MPL, S>,
P: BulkProducer<Item = u8, Final = ()>,
H: Default + Hasher<PD>,
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD> + Debug,
N: Debug,
S: Debug,
PD: Debug,
Creates an
AuthorisedEntry with the given data and payload, and atomically inserts the payload and entry into the store. Read moreSource§async fn create_entry_nondestructive<Data, P, H>(
&mut self,
data: &Data,
payload_producer: P,
payload_length: u64,
ingredients: &AT::Ingredients,
) -> Result<NondestructiveInsert<MCL, MCC, MPL, N, S, PD, AT>, CreateEntryError<Self::InternalError, P::Error, AT::CreationError>>where
Data: ?Sized + Namespaced<N> + Coordinatelike<MCL, MCC, MPL, S>,
P: BulkProducer<Item = u8, Final = ()>,
H: Default + Hasher<PD>,
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD> + Debug,
N: Debug,
S: Debug,
PD: Debug,
async fn create_entry_nondestructive<Data, P, H>(
&mut self,
data: &Data,
payload_producer: P,
payload_length: u64,
ingredients: &AT::Ingredients,
) -> Result<NondestructiveInsert<MCL, MCC, MPL, N, S, PD, AT>, CreateEntryError<Self::InternalError, P::Error, AT::CreationError>>where
Data: ?Sized + Namespaced<N> + Coordinatelike<MCL, MCC, MPL, S>,
P: BulkProducer<Item = u8, Final = ()>,
H: Default + Hasher<PD>,
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD> + Debug,
N: Debug,
S: Debug,
PD: Debug,
Source§async fn insert_entry(
&mut self,
entry: AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>,
) -> Result<bool, Self::InternalError>
async fn insert_entry( &mut self, entry: AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>, ) -> Result<bool, Self::InternalError>
Inserts a given
AuthorisedEntry into the store. Read moreSource§async fn forget_entry<K>(
&mut self,
namespace_id: &N,
key: &K,
expected_digest: Option<PD>,
) -> Result<bool, Self::InternalError>
async fn forget_entry<K>( &mut self, namespace_id: &N, key: &K, expected_digest: Option<PD>, ) -> Result<bool, Self::InternalError>
Removes an entry and its payload from the store. Return
Ok(true) if data was actually removed, and Ok(false) if there was no matching entry in the first place. Read moreSource§async fn forget_area(
&mut self,
namespace_id: &N,
area: &Area<MCL, MCC, MPL, S>,
) -> Result<(), Self::InternalError>
async fn forget_area( &mut self, namespace_id: &N, area: &Area<MCL, MCC, MPL, S>, ) -> Result<(), Self::InternalError>
Source§async fn forget_namespace(
&mut self,
namespace_id: &N,
) -> Result<(), Self::InternalError>
async fn forget_namespace( &mut self, namespace_id: &N, ) -> Result<(), Self::InternalError>
Removes all entries and their payloads in some namespace from the store. Read more
Source§async fn get_entry<K, Slice>(
&mut self,
namespace_id: &N,
key: &K,
expected_digest: Option<PD>,
payload_slice: &Slice,
) -> Result<Option<(AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>, impl BulkProducer<Item = u8, Final = (), Error = PayloadProducerError<Self::InternalError>>)>, Self::InternalError>
async fn get_entry<K, Slice>( &mut self, namespace_id: &N, key: &K, expected_digest: Option<PD>, payload_slice: &Slice, ) -> Result<Option<(AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>, impl BulkProducer<Item = u8, Final = (), Error = PayloadProducerError<Self::InternalError>>)>, Self::InternalError>
Gets an entry (or
None if there is none) together with a producer its payload (more specifically, the indicated payload_slice). Read moreSource§async fn get_area(
&mut self,
namespace_id: N,
area: Area<MCL, MCC, MPL, S>,
) -> impl Producer<Item = AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>, Final = (), Error = Self::InternalError>
async fn get_area( &mut self, namespace_id: N, area: Area<MCL, MCC, MPL, S>, ) -> impl Producer<Item = AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>, Final = (), Error = Self::InternalError>
Returns a producer of all entries in some
Area from the store.Auto Trait Implementations§
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Freeze for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> !RefUnwindSafe for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> !Send for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> !Sync for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Unpin for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> !UnwindSafe for MemoryStore<MCL, MCC, MPL, N, S, PD, AT>
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> 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