Struct sov_state::storage::StorageValue
source · pub struct StorageValue { /* private fields */ }Expand description
A serialized value suitable for storing. Internally uses an Arc<Vec<u8>> for cheap cloning.
Implementations§
source§impl StorageValue
impl StorageValue
sourcepub fn new<V, VC>(value: &V, codec: &VC) -> Selfwhere
VC: StateValueCodec<V>,
pub fn new<V, VC>(value: &V, codec: &VC) -> Selfwhere VC: StateValueCodec<V>,
Create a new storage value by serializing the input with the given codec.
sourcepub fn into_cache_value(self) -> CacheValue
pub fn into_cache_value(self) -> CacheValue
Convert this value into a CacheValue.
Trait Implementations§
source§impl BorshDeserialize for StorageValuewhere
Arc<Vec<u8>>: BorshDeserialize,
impl BorshDeserialize for StorageValuewhere Arc<Vec<u8>>: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where R: Read,
source§impl BorshSerialize for StorageValuewhere
Arc<Vec<u8>>: BorshSerialize,
impl BorshSerialize for StorageValuewhere Arc<Vec<u8>>: BorshSerialize,
source§impl Clone for StorageValue
impl Clone for StorageValue
source§fn clone(&self) -> StorageValue
fn clone(&self) -> StorageValue
Returns a copy of the value. Read more
1.0.0 · 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 StorageValue
impl Debug for StorageValue
source§impl Default for StorageValue
impl Default for StorageValue
source§fn default() -> StorageValue
fn default() -> StorageValue
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for StorageValue
impl<'de> Deserialize<'de> for StorageValue
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<CacheValue> for StorageValue
impl From<CacheValue> for StorageValue
source§fn from(cache_value: CacheValue) -> Self
fn from(cache_value: CacheValue) -> Self
Converts to this type from the input type.
source§impl PartialEq<StorageValue> for StorageValue
impl PartialEq<StorageValue> for StorageValue
source§fn eq(&self, other: &StorageValue) -> bool
fn eq(&self, other: &StorageValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for StorageValue
impl Serialize for StorageValue
impl Eq for StorageValue
impl StructuralEq for StorageValue
impl StructuralPartialEq for StorageValue
Auto Trait Implementations§
impl RefUnwindSafe for StorageValue
impl Send for StorageValue
impl Sync for StorageValue
impl Unpin for StorageValue
impl UnwindSafe for StorageValue
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