pub struct Client { /* private fields */ }Expand description
A client for interacting with a Percas cluster.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn get(&self, key: &str) -> Result<Option<Vec<u8>>, Error>
pub async fn get(&self, key: &str) -> Result<Option<Vec<u8>>, Error>
Get the value associated with the given key.
Sourcepub async fn put(&self, key: &str, value: &[u8]) -> Result<(), Error>
pub async fn put(&self, key: &str, value: &[u8]) -> Result<(), Error>
Set the value associated with the given key.
Sourcepub async fn put_owned<T: Into<Body>>(
&self,
key: &str,
value: T,
) -> Result<(), Error>
pub async fn put_owned<T: Into<Body>>( &self, key: &str, value: T, ) -> Result<(), Error>
Set the value associated with the given key.
This method exists to avoid an extra copy when the caller has ownership of the data:
&'static strVec<u8>bytes::Bytesreqwest::Body
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more