#[repr(C)]pub enum KeyValueResult {
Ok {
response: KeyValueResponse,
},
Err {
error: KeyValueError,
},
}Expand description
The result of an operation on the store.
Note: we can’t use core::result::Result here because it is not currently
supported across the FFI boundary, when using typegen or facet_typegen.
Variants§
Implementations§
Source§impl KeyValueResult
impl KeyValueResult
Sourcepub fn unwrap_get(self) -> Result<Option<Vec<u8>>, KeyValueError>
pub fn unwrap_get(self) -> Result<Option<Vec<u8>>, KeyValueError>
Converts a KeyValueResult into a Result
§Errors
Passes any errors from the underlying KeyValueError to the returned Result.
§Panics
Panics if the KeyValueResult is not a KeyValueResponse::Get.
Sourcepub fn unwrap_set(self) -> Result<Option<Vec<u8>>, KeyValueError>
pub fn unwrap_set(self) -> Result<Option<Vec<u8>>, KeyValueError>
Converts a KeyValueResult into a Result
§Errors
Passes any errors from the underlying KeyValueError to the returned Result.
§Panics
Panics if the KeyValueResult is not a KeyValueResponse::Set.
Sourcepub fn unwrap_delete(self) -> Result<Option<Vec<u8>>, KeyValueError>
pub fn unwrap_delete(self) -> Result<Option<Vec<u8>>, KeyValueError>
Converts a KeyValueResult into a Result
§Errors
Passes any errors from the underlying KeyValueError to the returned Result.
§Panics
Panics if the KeyValueResult is not a KeyValueResponse::Delete.
Sourcepub fn unwrap_exists(self) -> Result<bool, KeyValueError>
pub fn unwrap_exists(self) -> Result<bool, KeyValueError>
Converts a KeyValueResult into a Result
§Errors
Passes any errors from the underlying KeyValueError to the returned Result.
§Panics
Panics if the KeyValueResult is not a KeyValueResponse::Exists.
Sourcepub fn unwrap_list_keys(self) -> Result<(Vec<String>, u64), KeyValueError>
pub fn unwrap_list_keys(self) -> Result<(Vec<String>, u64), KeyValueError>
Converts a KeyValueResult into a Result
§Errors
Passes any errors from the underlying KeyValueError to the returned Result.
§Panics
Panics if the KeyValueResult is not a KeyValueResponse::ListKeys.
Trait Implementations§
Source§impl Clone for KeyValueResult
impl Clone for KeyValueResult
Source§fn clone(&self) -> KeyValueResult
fn clone(&self) -> KeyValueResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more