pub struct StorageInfo<'info, TypeId: Clone> {
pub keys: Cow<'info, [StorageKeyInfo<TypeId>]>,
pub value_id: TypeId,
pub default_value: Option<Cow<'info, [u8]>>,
}Expand description
Information about a storage entry.
Fields§
§keys: Cow<'info, [StorageKeyInfo<TypeId>]>No entries if a plain storage entry, or N entries for N maps.
value_id: TypeIdThe type of the values.
default_value: Option<Cow<'info, [u8]>>Bytes representing the default value for this entry, if one exists.
Implementations§
Source§impl<'info, TypeId: Clone + 'static> StorageInfo<'info, TypeId>
impl<'info, TypeId: Clone + 'static> StorageInfo<'info, TypeId>
Sourcepub fn into_owned(self) -> StorageInfo<'static, TypeId>
pub fn into_owned(self) -> StorageInfo<'static, TypeId>
Take ownership of this StorageInfo, turning any lifetimes to 'static.
Sourcepub fn map_ids<NewTypeId: Clone, E, F: FnMut(TypeId) -> Result<NewTypeId, E>>(
self,
f: F,
) -> Result<StorageInfo<'static, NewTypeId>, E>
pub fn map_ids<NewTypeId: Clone, E, F: FnMut(TypeId) -> Result<NewTypeId, E>>( self, f: F, ) -> Result<StorageInfo<'static, NewTypeId>, E>
Map the type IDs in this StorageInfo, returning a new one or bailing early with an error if something goes wrong.
This also takes ownership of the StorageInfo, turning the lifetime to static.
Trait Implementations§
Source§impl<'info, TypeId: Clone + Clone> Clone for StorageInfo<'info, TypeId>
impl<'info, TypeId: Clone + Clone> Clone for StorageInfo<'info, TypeId>
Source§fn clone(&self) -> StorageInfo<'info, TypeId>
fn clone(&self) -> StorageInfo<'info, TypeId>
Returns a duplicate 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 moreimpl<'info, TypeId: Eq + Clone> Eq for StorageInfo<'info, TypeId>
impl<'info, TypeId: Clone> StructuralPartialEq for StorageInfo<'info, TypeId>
Auto Trait Implementations§
impl<'info, TypeId> Freeze for StorageInfo<'info, TypeId>where
TypeId: Freeze,
impl<'info, TypeId> RefUnwindSafe for StorageInfo<'info, TypeId>where
TypeId: RefUnwindSafe,
impl<'info, TypeId> Send for StorageInfo<'info, TypeId>
impl<'info, TypeId> Sync for StorageInfo<'info, TypeId>where
TypeId: Sync,
impl<'info, TypeId> Unpin for StorageInfo<'info, TypeId>where
TypeId: Unpin,
impl<'info, TypeId> UnwindSafe for StorageInfo<'info, TypeId>where
TypeId: UnwindSafe + RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more