[−][src]Struct lucid_kv_client::LucidClient
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]
&'_ self,
key: K,
value: V
) -> Result<PutStatus, Error>
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]
&'_ self,
key: K
) -> Result<Option<Bytes>, Error>
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]
&'_ self,
key: K,
value: &'_ V
) -> Result<PutStatus, Error>
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]
&'_ self,
key: K
) -> Result<Option<V>, Error>
Get the value for a key and deserialize it into a rust object
Trait Implementations
impl Clone for LucidClient
[src]
fn clone(&self) -> LucidClient
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for LucidClient
[src]
Auto Trait Implementations
impl !RefUnwindSafe for LucidClient
impl Send for LucidClient
impl Sync for LucidClient
impl Unpin for LucidClient
impl !UnwindSafe for LucidClient
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,