[][src]Struct z_rs::Records

pub struct Records { /* fields omitted */ }

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]

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]

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.