pub struct RingMemory { /* private fields */ }Expand description
Bounded ring buffer keeping the most recent capacity entries.
Implementations§
Trait Implementations§
Source§impl MemoryPort for RingMemory
impl MemoryPort for RingMemory
Source§type Error = MemoryError
type Error = MemoryError
Error type returned by memory operations.
Source§fn append(&self, key: &str, content: &str) -> Result<Uuid, Self::Error>
fn append(&self, key: &str, content: &str) -> Result<Uuid, Self::Error>
Append a new entry under
key with content. Returns the new id.Source§fn get(&self, key: &str) -> Result<Option<String>, Self::Error>
fn get(&self, key: &str) -> Result<Option<String>, Self::Error>
Return the latest value for
key, if any.Auto Trait Implementations§
impl !Freeze for RingMemory
impl RefUnwindSafe for RingMemory
impl Send for RingMemory
impl Sync for RingMemory
impl Unpin for RingMemory
impl UnsafeUnpin for RingMemory
impl UnwindSafe for RingMemory
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