pub struct MemoryPersister { /* private fields */ }Expand description
For Testing An in-memory persister.
As this provides no actual persistence it should not be used for any real application, it actually reduces performance of the plain backend slightly due to tracking the changes itself.
Trait Implementations§
Source§impl Debug for MemoryPersister
impl Debug for MemoryPersister
Source§impl Default for MemoryPersister
impl Default for MemoryPersister
Source§fn default() -> MemoryPersister
fn default() -> MemoryPersister
Returns the “default value” for a type. Read more
Source§impl Persister for MemoryPersister
impl Persister for MemoryPersister
Source§fn insert_changes(
&mut self,
changes: Vec<(ActorId, u64, Vec<u8>)>,
) -> Result<(), Self::Error>
fn insert_changes( &mut self, changes: Vec<(ActorId, u64, Vec<u8>)>, ) -> Result<(), Self::Error>
Insert changes into the map.
Source§fn remove_changes(
&mut self,
changes: Vec<(&ActorId, u64)>,
) -> Result<(), Self::Error>
fn remove_changes( &mut self, changes: Vec<(&ActorId, u64)>, ) -> Result<(), Self::Error>
Remove changes from the map.
Source§type Error = Infallible
type Error = Infallible
The error type that the operations can produce
Source§fn get_sync_state(&self, peer_id: &[u8]) -> Result<Option<Vec<u8>>, Self::Error>
fn get_sync_state(&self, peer_id: &[u8]) -> Result<Option<Vec<u8>>, Self::Error>
Returns the sync state for the given peer if one exists. Read more
Source§fn set_sync_state(
&mut self,
peer_id: Vec<u8>,
sync_state: Vec<u8>,
) -> Result<(), Self::Error>
fn set_sync_state( &mut self, peer_id: Vec<u8>, sync_state: Vec<u8>, ) -> Result<(), Self::Error>
Sets the sync state for the given peer. Read more
Source§fn remove_sync_states(&mut self, peer_ids: &[&[u8]]) -> Result<(), Self::Error>
fn remove_sync_states(&mut self, peer_ids: &[&[u8]]) -> Result<(), Self::Error>
Removes the sync states associated with the given
peer_ids.Source§fn get_peer_ids(&self) -> Result<Vec<Vec<u8>>, Self::Error>
fn get_peer_ids(&self) -> Result<Vec<Vec<u8>>, Self::Error>
Returns the list of peer ids with stored
SyncStates. Read moreSource§fn sizes(&self) -> StoredSizes
fn sizes(&self) -> StoredSizes
Returns the sizes components being stored consume. Read more
Auto Trait Implementations§
impl Freeze for MemoryPersister
impl RefUnwindSafe for MemoryPersister
impl Send for MemoryPersister
impl Sync for MemoryPersister
impl Unpin for MemoryPersister
impl UnwindSafe for MemoryPersister
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> 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 more