pub struct Kv { /* private fields */ }Implementations§
Source§impl Kv
impl Kv
Sourcepub fn new(handle: EnvoyHandle, actor_id: impl Into<String>) -> Self
pub fn new(handle: EnvoyHandle, actor_id: impl Into<String>) -> Self
actor_id stays on Kv because envoy-client KV calls require it on every request.
pub fn new_in_memory() -> Self
pub async fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>
pub async fn put(&self, key: &[u8], value: &[u8]) -> Result<()>
pub async fn delete(&self, key: &[u8]) -> Result<()>
pub async fn delete_range(&self, start: &[u8], end: &[u8]) -> Result<()>
pub async fn list_prefix( &self, prefix: &[u8], opts: ListOpts, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>>
pub async fn list_range( &self, start: &[u8], end: &[u8], opts: ListOpts, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>>
pub async fn batch_get(&self, keys: &[&[u8]]) -> Result<Vec<Option<Vec<u8>>>>
pub async fn batch_put(&self, entries: &[(&[u8], &[u8])]) -> Result<()>
pub async fn apply_batch( &self, puts: &[(Vec<u8>, Vec<u8>)], deletes: &[Vec<u8>], ) -> Result<()>
pub async fn batch_delete(&self, keys: &[&[u8]]) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Kv
impl !UnwindSafe for Kv
impl Freeze for Kv
impl Send for Kv
impl Sync for Kv
impl Unpin for Kv
impl UnsafeUnpin for Kv
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