#[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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KeyValueResult
impl Debug for KeyValueResult
Source§impl<'de> Deserialize<'de> for KeyValueResult
impl<'de> Deserialize<'de> for KeyValueResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'ʄ> Facet<'ʄ> for KeyValueResult
impl<'ʄ> Facet<'ʄ> for KeyValueResult
Source§impl PartialEq for KeyValueResult
impl PartialEq for KeyValueResult
Source§fn eq(&self, other: &KeyValueResult) -> bool
fn eq(&self, other: &KeyValueResult) -> bool
self and other values to be equal, and is used by ==.