pub struct Storage {
kind: StorageKind,
ty: StorageType,
target: ItemStruct,
getter: Option<Ident>,
}
Expand description
Storage attributes parser
Fields§
§kind: StorageKind
Storage kind (persistent or transient)
ty: StorageType
kind of the storage
target: ItemStruct
The source and the target storage struct
getter: Option<Ident>
Getter function of storage
Implementations§
Source§impl Storage
impl Storage
Sourcepub fn parse(ty: StorageType, target: ItemStruct) -> TokenStream
pub fn parse(ty: StorageType, target: ItemStruct) -> TokenStream
Parse from proc_macro attribute for persistent storage
Sourcepub fn parse_transient(ty: StorageType, target: ItemStruct) -> TokenStream
pub fn parse_transient(ty: StorageType, target: ItemStruct) -> TokenStream
Parse from proc_macro attribute for transient storage
fn from_parts(kind: StorageKind, ty: StorageType, target: ItemStruct) -> Self
fn expand(self) -> TokenStream
fn expand_value(&mut self, value: Ident) -> TokenStream
fn expand_mapping(&mut self, key: Ident, value: Ident) -> TokenStream
fn expand_dk_mapping( &mut self, key1: Ident, key2: Ident, value: Ident, ) -> TokenStream
fn get_storage_slot(&self, name: String) -> i32
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl !Send for Storage
impl !Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
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