QuickMemoryClient

Struct QuickMemoryClient 

Source
pub struct QuickMemoryClient<T>
where T: Serialize + DeserializeOwned + Debug + Eq + PartialEq + Hash + Send + Sync + Clone + 'static,
{ /* private fields */ }

Trait Implementations§

Source§

impl<T> BaseClient<T> for QuickMemoryClient<T>
where T: Serialize + DeserializeOwned + Debug + Eq + PartialEq + Hash + Send + Sync + Clone + 'static,

Source§

fn new(config: ClientConfig) -> Self

Creates a new instance of the client. Read more
Source§

fn get(&mut self, key: &str) -> Result<Option<T>>

Get the value associated with a key. Read more
Source§

fn set(&mut self, key: &str, value: T) -> Result<()>

Set the value associated with a key. Read more
Source§

fn update(&mut self, key: &str, value: T, upsert: Option<bool>) -> Result<()>

Update the value associated with a key. Read more
Source§

fn delete(&mut self, key: &str) -> Result<()>

Delete the value associated with a key. Read more
Source§

fn exists(&mut self, key: &str) -> Result<bool>

Check if a key exists in the database. Read more
Source§

fn keys(&mut self) -> Result<Option<Vec<String>>>

Get all keys in the database. Read more
Source§

fn values(&mut self) -> Result<Option<Vec<T>>>

Get all values in the database. Read more
Source§

fn len(&mut self) -> Result<usize>

Get the number of keys in the database. Read more
Source§

fn purge(&mut self) -> Result<()>

Clears all keys and values from the database. Read more
Source§

fn get_many(&mut self, keys: &[&str]) -> Result<Option<Vec<T>>>

Get multiple values associated with multiple keys. Read more
Source§

fn set_many(&mut self, keys: &[&str], values: &[T]) -> Result<()>

Set multiple values associated with multiple keys. Read more
Source§

fn delete_many(&mut self, keys: &[&str]) -> Result<()>

Delete multiple values associated with multiple keys. Read more
Source§

fn update_many( &mut self, keys: &[&str], values: &[T], upsert: Option<bool>, ) -> Result<()>

Update multiple values associated with multiple keys. Read more
Source§

impl<T> Debug for QuickMemoryClient<T>
where T: Serialize + DeserializeOwned + Debug + Eq + PartialEq + Hash + Send + Sync + Clone + 'static + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.