pub struct Escrow<T> { /* private fields */ }Expand description
Collection of values, which removes values older than duration
Implementations§
source§impl<T: Serialize + DeserializeOwned + PartialEq + Clone> Escrow<T>
impl<T: Serialize + DeserializeOwned + PartialEq + Clone> Escrow<T>
pub fn new<V>(name: V, duration: Duration, escrow_db: Arc<EscrowDb>) -> Self
pub fn add(&self, id: &IdentifierPrefix, event: T) -> Result<(), DbError>
pub fn get( &self, id: &IdentifierPrefix, ) -> Option<impl DoubleEndedIterator<Item = T>>
pub fn remove(&self, id: &IdentifierPrefix, event: &T) -> Result<(), DbError>
pub fn get_all(&self) -> Option<impl DoubleEndedIterator<Item = T>>
Auto Trait Implementations§
impl<T> Freeze for Escrow<T>
impl<T> !RefUnwindSafe for Escrow<T>
impl<T> Send for Escrow<T>where
T: Send,
impl<T> Sync for Escrow<T>where
T: Sync,
impl<T> Unpin for Escrow<T>where
T: Unpin,
impl<T> !UnwindSafe for Escrow<T>
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