[−][src]Struct z_rs::Records
Records contains a record of all stored values
Implementations
impl Records
[src]
pub fn new() -> Records
[src]
new creates a new Records instance
pub fn update<T>(&mut self, path: T, ts: u64) where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
update increments the rank of the provided path and updates its timestamp
pub fn query<T>(&self, arguments: &[T]) -> Option<Vec<u8>> where
T: AsRef<[u8]>,
[src]
T: AsRef<[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.
pub fn query_and_update<T>(
&mut self,
arguments: &[T],
ts: u64
) -> Option<Vec<u8>> where
T: AsRef<[u8]>,
[src]
&mut self,
arguments: &[T],
ts: u64
) -> Option<Vec<u8>> where
T: AsRef<[u8]>,
query_and_update runs a query followed by an update with the result of the query.
Trait Implementations
impl Debug for Records
[src]
impl Default for Records
[src]
impl<'de> Deserialize<'de> for Records
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Records
[src]
Auto Trait Implementations
impl RefUnwindSafe for Records
impl Send for Records
impl Sync for Records
impl Unpin for Records
impl UnwindSafe for Records
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,