pub struct KvClient { /* private fields */ }Expand description
KV client with automatic leader tracking and retry with exponential backoff.
Implementations§
Source§impl KvClient
impl KvClient
pub fn new(nodes: HashMap<NodeId, String>) -> Self
pub async fn get(&mut self, key: &[u8]) -> Result<GetResponse, Status>
pub async fn put( &mut self, key: &[u8], value: &[u8], ) -> Result<PutResponse, Status>
pub async fn put_with_options( &mut self, key: &[u8], value: &[u8], lease_id: i64, ttl_seconds: i64, ) -> Result<PutResponse, Status>
pub async fn delete(&mut self, key: &[u8]) -> Result<DeleteResponse, Status>
pub async fn range( &mut self, start_key: &[u8], end_key: &[u8], limit: i64, ) -> Result<RangeResponse, Status>
Auto Trait Implementations§
impl Freeze for KvClient
impl !RefUnwindSafe for KvClient
impl Send for KvClient
impl Sync for KvClient
impl Unpin for KvClient
impl UnsafeUnpin for KvClient
impl !UnwindSafe for KvClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request