pub struct Records { /* private fields */ }
Expand description
Records contains a record of all stored values
Implementations§
Source§impl Records
impl Records
Sourcepub fn update<T>(&mut self, path: T, ts: u64)
pub fn update<T>(&mut self, path: T, ts: u64)
update increments the rank of the provided path and updates its timestamp
Sourcepub fn query<T>(&self, arguments: &[T]) -> Option<Vec<u8>>
pub fn query<T>(&self, arguments: &[T]) -> Option<Vec<u8>>
query matches a record from the saved records from the given arguments. The rank of a record is how many times it has been used. The match is returned based on “frecency”, i.e. the highest ranked matching record is given priority, if there are multiple then the most recently accessed record with the same rank is returned.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Records
impl<'de> Deserialize<'de> for Records
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Records
impl RefUnwindSafe for Records
impl Send for Records
impl Sync for Records
impl Unpin for Records
impl UnwindSafe for Records
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