[−][src]Struct caspaxos_kv::Client
Fields
known_servers: Vec<SocketAddr>
net: Net
cache: HashMap<Vec<u8>, CacheEntry>
processor: Option<Task<Result<()>>>
Implementations
impl Client
[src]
pub async fn ping<'_>(&'_ mut self) -> usize
[src]
Send a Ping
to the Server
, which
hopefully will respond with a Pong
.
pub async fn get<K: AsRef<[u8]>, '_>(
&'_ mut self,
key: K
) -> Result<VersionedValue>
[src]
&'_ mut self,
key: K
) -> Result<VersionedValue>
Get the value associated with a key, if any.
pub async fn set<K, V, '_>(
&'_ mut self,
key: K,
value: V
) -> Result<Option<Vec<u8>>> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
[src]
&'_ mut self,
key: K,
value: V
) -> Result<Option<Vec<u8>>> where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
Set a key to a new value. Returns the previous set value.
pub async fn del<K: AsRef<[u8]>, '_>(
&'_ mut self,
key: K
) -> Result<Option<Vec<u8>>>
[src]
&'_ mut self,
key: K
) -> Result<Option<Vec<u8>>>
Delete a value associated with a key. Returns the previously set value, if any.
pub async fn cas<K: AsRef<[u8]>, '_>(
&'_ mut self,
key: K,
old: VersionedValue,
new: Option<Vec<u8>>
) -> Result<Result<VersionedValue, VersionedValue>>
[src]
&'_ mut self,
key: K,
old: VersionedValue,
new: Option<Vec<u8>>
) -> Result<Result<VersionedValue, VersionedValue>>
Given a previous versioned value, either set (with Some
) or
delete (with None
) a new value. Returns either Ok(new_version)
or Err(current_versioned_value)
. Returns an error if the old value is not
correctly guessed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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, 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,