pub struct StoredValue(/* private fields */);Implementations§
Source§impl StoredValue
impl StoredValue
Sourcepub fn encode<T: Serialize>(value: &T) -> Result<StoredValue, SettingsError>
pub fn encode<T: Serialize>(value: &T) -> Result<StoredValue, SettingsError>
Given a reference to a value of type T, return it as a StoredValue instance with the original value JSON encoded.
pub fn decode<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn as_str(&self) -> &str
Sourcepub fn from_raw(serialized: String) -> StoredValue
pub fn from_raw(serialized: String) -> StoredValue
Wrap a raw, JSON-encoded string as a Stored Value. For use by backends that read pre-serialized values from persistent storage. The caller is responsible for ensuring the string is valid JSON.
Trait Implementations§
Source§impl Clone for StoredValue
impl Clone for StoredValue
Source§fn clone(&self) -> StoredValue
fn clone(&self) -> StoredValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StoredValue
impl Debug for StoredValue
impl Eq for StoredValue
Source§impl PartialEq for StoredValue
impl PartialEq for StoredValue
Source§fn eq(&self, other: &StoredValue) -> bool
fn eq(&self, other: &StoredValue) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StoredValue
Auto Trait Implementations§
impl Freeze for StoredValue
impl RefUnwindSafe for StoredValue
impl Send for StoredValue
impl Sync for StoredValue
impl Unpin for StoredValue
impl UnsafeUnpin for StoredValue
impl UnwindSafe for StoredValue
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