[][src]Struct lucid_kv_client::LucidClient

pub struct LucidClient { /* fields omitted */ }

The main Client

Implementations

impl LucidClient[src]

pub fn new<U: AsRef<str> + ?Sized>(base_url: &U) -> Result<Self, Error>[src]

Build a basic Client. This is equivalent to Builder::new(url).build()

pub fn builder<'a, U: AsRef<str> + ?Sized>(base_url: &'a U) -> Builder<'a>[src]

Configure a Client with the Builder

pub async fn put_raw<'_, K: AsRef<str>, V: Into<Body>>(
    &'_ self,
    key: K,
    value: V
) -> Result<PutStatus, Error>
[src]

Store a string or bytes as a value for a key. Creates a new key if it does not exist

pub async fn get_raw<'_, K: AsRef<str>>(
    &'_ self,
    key: K
) -> Result<Option<Bytes>, Error>
[src]

Gets raw bytes from a key's value

pub async fn delete<'_, K: AsRef<str>>(&'_ self, key: K) -> Result<bool, Error>[src]

Delete a key's value. Returns true if the key existed and was actually deleted

pub async fn exists<'_, K: AsRef<str>>(&'_ self, key: K) -> Result<bool, Error>[src]

Check if a key exists

pub async fn put<'_, '_, K: AsRef<str>, V: Serialize>(
    &'_ self,
    key: K,
    value: &'_ V
) -> Result<PutStatus, Error>
[src]

Serialize a rust object and store as the value for a key

pub async fn get<'_, K: AsRef<str>, V: DeserializeOwned>(
    &'_ self,
    key: K
) -> Result<Option<V>, Error>
[src]

Get the value for a key and deserialize it into a rust object

Trait Implementations

impl Clone for LucidClient[src]

impl Debug for LucidClient[src]

Auto Trait Implementations

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> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.