[−][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 health_check<'_>(&'_ self) -> Result<(), Error>
[src]
Health check
pub async fn put_raw<'_, '_, K: AsRef<str> + ?Sized, 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> + ?Sized>(
&'_ 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> + ?Sized>(
&'_ self,
key: &'_ K
) -> Result<bool, Error>
[src]
&'_ self,
key: &'_ K
) -> Result<bool, Error>
Delete a key's value. Returns true
if the key existed and was actually deleted
pub async fn exists<'_, '_, K: AsRef<str> + ?Sized>(
&'_ self,
key: &'_ K
) -> Result<bool, Error>
[src]
&'_ self,
key: &'_ K
) -> Result<bool, Error>
Check if a key exists
pub async fn put<'_, '_, '_, K: AsRef<str> + ?Sized, V: Serialize + ?Sized>(
&'_ 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> + ?Sized, 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
pub async fn lock<'_, '_, K: AsRef<str> + ?Sized>(
&'_ self,
key: &'_ K
) -> Result<bool, Error>
[src]
&'_ self,
key: &'_ K
) -> Result<bool, Error>
Lock a key. Returns false
if the key is already locked and true
otherwise
pub async fn unlock<'_, '_, K: AsRef<str> + ?Sized>(
&'_ self,
key: &'_ K
) -> Result<bool, Error>
[src]
&'_ self,
key: &'_ K
) -> Result<bool, Error>
Unlock a key. Returns false
if the key is already unlocked and true
otherwise
pub async fn increment<'_, '_, K: AsRef<str> + ?Sized>(
&'_ self,
key: &'_ K
) -> Result<(), Error>
[src]
&'_ self,
key: &'_ K
) -> Result<(), Error>
Increment a key. Note the key's value must be like b"0"
otherwise this will throw an
Error::NonNumericValue
pub async fn decrement<'_, '_, K: AsRef<str> + ?Sized>(
&'_ self,
key: &'_ K
) -> Result<(), Error>
[src]
&'_ self,
key: &'_ K
) -> Result<(), Error>
Decrement a key. See LucidClient::increment for more info.
pub async fn ttl<'_, '_, K: AsRef<str> + ?Sized>(
&'_ self,
key: &'_ K,
duration: Duration
) -> Result<(), Error>
[src]
&'_ self,
key: &'_ K,
duration: Duration
) -> Result<(), Error>
Add a "time to live" constraint to a key
pub async fn notifications_raw<'_, F, E>(
&'_ self,
handler: F
) -> Result<impl Stream<Item = Result<Notification<Bytes>, NotificationError<E>>>, Error> where
F: ErrorHandler<Error, OutError = E>,
E: Display + Debug + Send + Sync + 'static,
[src]
&'_ self,
handler: F
) -> Result<impl Stream<Item = Result<Notification<Bytes>, NotificationError<E>>>, Error> where
F: ErrorHandler<Error, OutError = E>,
E: Display + Debug + Send + Sync + 'static,
Get raw notification blobs
pub async fn notifications<'_, F, T, E>(
&'_ self,
handler: F
) -> Result<impl Stream<Item = Result<Notification<T>, NotificationError<E>>>, Error> where
F: ErrorHandler<Error, OutError = E>,
E: Display + Debug + Send + Sync + 'static,
T: DeserializeOwned,
[src]
&'_ self,
handler: F
) -> Result<impl Stream<Item = Result<Notification<T>, NotificationError<E>>>, Error> where
F: ErrorHandler<Error, OutError = E>,
E: Display + Debug + Send + Sync + 'static,
T: DeserializeOwned,
Get notifications and deserialize them into objects
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>,