pub enum Storage {
Counter,
Cell {
of: TypeDescriptor,
},
Map {
key: TypeDescriptor,
value: TypeDescriptor,
},
Set {
of: TypeDescriptor,
},
List {
of: TypeDescriptor,
},
MerkleTree {
of: TypeDescriptor,
},
HistoricMerkleTree {
of: TypeDescriptor,
},
}Expand description
Storage shape of a ledger field. Discriminated on a "storage"
JSON tag — the wire format compactc emits is:
{ "storage": "Counter" }
{ "storage": "Cell", "type": <TypeDescriptor> }
{ "storage": "Map", "key": <TypeDescriptor>, "value": <TypeDescriptor> }
{ "storage": "Set", "type": <TypeDescriptor> }
{ "storage": "List", "type": <TypeDescriptor> }
{ "storage": "MerkleTree", "type": <TypeDescriptor> }
{ "storage": "HistoricMerkleTree", "type": <TypeDescriptor> }Typed here so codegen + runtime can match on the enum directly
instead of reaching into serde_json::Value to sniff a
discriminant. Mirrors the pattern RuntimeValue introduced for
values: anywhere we used to carry raw serde_json::Value, we
carry a typed moonproof enum instead.
Variants§
Counter
Cell
Fields
§
of: TypeDescriptorMap
Set
Fields
§
of: TypeDescriptorList
Fields
§
of: TypeDescriptorMerkleTree
Fields
§
of: TypeDescriptorHistoricMerkleTree
Fields
§
of: TypeDescriptorImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Storage
impl<'de> Deserialize<'de> for Storage
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
impl StructuralPartialEq for Storage
Auto Trait Implementations§
impl Forget for Storage
impl Freeze for Storagewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const TypeDescriptor is !null: Freeze,
PhantomData<TypeDescriptor>: Freeze,
PhantomData<StructField>: Freeze,
PhantomData<String>: Freeze,
PhantomData<ContractCircuitSig>: Freeze,
impl Move for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnsafeUnpin for Storagewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const TypeDescriptor is !null: UnsafeUnpin,
PhantomData<TypeDescriptor>: UnsafeUnpin,
PhantomData<StructField>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<ContractCircuitSig>: UnsafeUnpin,
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