pub struct KeyValueStoreRecord {
pub key: String,
pub value: Vec<u8>,
pub content_type: Option<String>,
}Expand description
A record (key + value + content type) in a key-value store.
Fields§
§key: StringThe record key.
value: Vec<u8>The raw value bytes.
content_type: Option<String>The MIME content type of the value, if reported by the API.
Implementations§
Source§impl KeyValueStoreRecord
impl KeyValueStoreRecord
Sourcepub fn as_text(&self) -> Result<String, FromUtf8Error>
pub fn as_text(&self) -> Result<String, FromUtf8Error>
Interprets the value as UTF-8 text.
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
Deserializes the value as JSON into T.
Trait Implementations§
Source§impl Clone for KeyValueStoreRecord
impl Clone for KeyValueStoreRecord
Auto Trait Implementations§
impl Freeze for KeyValueStoreRecord
impl RefUnwindSafe for KeyValueStoreRecord
impl Send for KeyValueStoreRecord
impl Sync for KeyValueStoreRecord
impl Unpin for KeyValueStoreRecord
impl UnsafeUnpin for KeyValueStoreRecord
impl UnwindSafe for KeyValueStoreRecord
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