pub struct OwnedState {
pub type_id: StateTypeId,
pub seal: SealRef,
pub data: Vec<u8>,
}Expand description
Owned state: state bound to a specific single-use seal
Examples: token ownership, NFT assignment, escrow position. Only the seal owner can consume or transfer this state.
Fields§
§type_id: StateTypeIdType identifier (defined in the schema)
seal: SealRefThe seal that owns this state
data: Vec<u8>Serialized state data (schema-defined format)
Implementations§
Source§impl OwnedState
impl OwnedState
Sourcepub fn from_hash(type_id: StateTypeId, seal: SealRef, value: Hash) -> Self
pub fn from_hash(type_id: StateTypeId, seal: SealRef, value: Hash) -> Self
Create owned state from a single hash value
Trait Implementations§
Source§impl Clone for OwnedState
impl Clone for OwnedState
Source§fn clone(&self) -> OwnedState
fn clone(&self) -> OwnedState
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 moreSource§impl Debug for OwnedState
impl Debug for OwnedState
Source§impl<'de> Deserialize<'de> for OwnedState
impl<'de> Deserialize<'de> for OwnedState
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 Hash for OwnedState
impl Hash for OwnedState
Source§impl PartialEq for OwnedState
impl PartialEq for OwnedState
Source§impl Serialize for OwnedState
impl Serialize for OwnedState
impl Eq for OwnedState
impl StructuralPartialEq for OwnedState
Auto Trait Implementations§
impl Freeze for OwnedState
impl RefUnwindSafe for OwnedState
impl Send for OwnedState
impl Sync for OwnedState
impl Unpin for OwnedState
impl UnsafeUnpin for OwnedState
impl UnwindSafe for OwnedState
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