Enum rgbstd::contract::Assign

source ·
pub enum Assign<State, Seal>where
    State: ExposedState,
    Seal: ExposedSeal,{
    Confidential {
        seal: SecretSeal,
        state: <State as ExposedState>::Confidential,
    },
    Revealed {
        seal: Seal,
        state: State,
    },
    ConfidentialSeal {
        seal: SecretSeal,
        state: State,
    },
    ConfidentialState {
        seal: Seal,
        state: <State as ExposedState>::Confidential,
    },
}
Expand description

State data are assigned to a seal definition, which means that they are owned by a person controlling spending of the seal UTXO, unless the seal is closed, indicating that a transfer of ownership had taken place

Variants§

§

Confidential

Fields

§state: <State as ExposedState>::Confidential
§

Revealed

Fields

§seal: Seal
§state: State
§

ConfidentialSeal

Fields

§state: State
§

ConfidentialState

Fields

§seal: Seal
§state: <State as ExposedState>::Confidential

Implementations§

source§

impl<State, Seal> Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source

pub fn revealed(seal: Seal, state: State) -> Assign<State, Seal>

source

pub fn with_seal_replaced( assignment: &Assign<State, Seal>, seal: Seal ) -> Assign<State, Seal>

source

pub fn to_confidential_seal(&self) -> SecretSeal

source

pub fn revealed_seal(&self) -> Option<Seal>

source

pub fn to_confidential_state(&self) -> <State as ExposedState>::Confidential

source

pub fn as_revealed_state(&self) -> Option<&State>

source

pub fn into_revealed_state(self) -> Option<State>

source

pub fn as_revealed(&self) -> Option<(&Seal, &State)>

source

pub fn to_revealed(&self) -> Option<(Seal, State)>

source

pub fn into_revealed(self) -> Option<(Seal, State)>

source§

impl<State> Assign<State, BlindSeal<Txid>>where State: ExposedState,

source

pub fn transmutate_seals(&self) -> Assign<State, BlindSeal<TxPtr>>

Trait Implementations§

source§

impl<State, Seal> Clone for Assign<State, Seal>where State: Clone + ExposedState, Seal: Clone + ExposedSeal, <State as ExposedState>::Confidential: Clone,

source§

fn clone(&self) -> Assign<State, Seal>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<State, Seal> CommitEncode for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal, Assign<State, Seal>: Clone,

source§

fn commit_encode(&self, e: &mut impl Write)

Encodes the data for the commitment by writing them directly into a io::Write writer instance
source§

impl<State, Seal> CommitmentId for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal, Assign<State, Seal>: Clone,

source§

const TAG: [u8; 32] = *b"urn:lnpbp:rgb:owned-state:v1#23A"

§

type Id = MerkleNode

Type of the resulting commitment.
source§

fn commitment_id(&self) -> Self::Id

Performs commitment to client-side-validated data
source§

impl<State, Seal> Conceal for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal, Assign<State, Seal>: Clone,

§

type Concealed = Assign<State, Seal>

The resulting confidential type concealing original data.
source§

fn conceal(&self) -> <Assign<State, Seal> as Conceal>::Concealed

Performs conceal procedure returning confidential data concealing original data.
source§

impl<State, Seal> Debug for Assign<State, Seal>where State: Debug + ExposedState, Seal: Debug + ExposedSeal, <State as ExposedState>::Confidential: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de, State, Seal> Deserialize<'de> for Assign<State, Seal>where State: ExposedState + Serialize + DeserializeOwned, Seal: ExposedSeal + Serialize + DeserializeOwned, <State as ExposedState>::Confidential: Serialize + DeserializeOwned,

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<Assign<State, Seal>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<State, Seal> Hash for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

fn hash<H>(&self, state: &mut H)where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<State: ExposedState, Seal: ExposedSeal> MergeReveal for Assign<State, Seal>

source§

fn merge_reveal(self, other: Self) -> Result<Self, MergeRevealError>

source§

impl<State, Seal> Ord for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

fn cmp(&self, other: &Assign<State, Seal>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<State, Seal> PartialEq<Assign<State, Seal>> for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

fn eq(&self, other: &Assign<State, Seal>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<State, Seal> PartialOrd<Assign<State, Seal>> for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

fn partial_cmp(&self, other: &Assign<State, Seal>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<State, Seal> Serialize for Assign<State, Seal>where State: ExposedState + Serialize + DeserializeOwned, Seal: ExposedSeal + Serialize + DeserializeOwned, <State as ExposedState>::Confidential: Serialize + DeserializeOwned,

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<State, Seal> StrictDecode for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

fn strict_decode( reader: &mut impl TypedRead ) -> Result<Assign<State, Seal>, DecodeError>

source§

impl<State, Seal> StrictDumb for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

fn strict_dumb() -> Assign<State, Seal>

source§

impl<State, Seal> StrictEncode for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where W: TypedWrite,

source§

impl<State, Seal> StrictSum for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

const ALL_VARIANTS: &'static [(u8, &'static str)] = &[(0 as u8, "confidential"), (3 as u8, "revealed"), (2 as u8, "confidentialSeal"), (1 as u8, "confidentialState")]

source§

fn variant_name(&self) -> &'static str

source§

fn strict_check_variants()

source§

fn variant_name_by_tag(tag: u8) -> Option<FieldName>

source§

fn variant_ord(&self) -> u8

source§

impl<State, Seal> StrictType for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB

source§

fn strict_name() -> Option<TypeName>

source§

impl<State, Seal> StrictUnion for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

source§

impl<State, Seal> Eq for Assign<State, Seal>where State: ExposedState, Seal: ExposedSeal,

Auto Trait Implementations§

§

impl<State, Seal> RefUnwindSafe for Assign<State, Seal>where Seal: RefUnwindSafe, State: RefUnwindSafe, <State as ExposedState>::Confidential: RefUnwindSafe,

§

impl<State, Seal> Send for Assign<State, Seal>where Seal: Send, State: Send, <State as ExposedState>::Confidential: Send,

§

impl<State, Seal> Sync for Assign<State, Seal>where Seal: Sync, State: Sync, <State as ExposedState>::Confidential: Sync,

§

impl<State, Seal> Unpin for Assign<State, Seal>where Seal: Unpin, State: Unpin, <State as ExposedState>::Confidential: Unpin,

§

impl<State, Seal> UnwindSafe for Assign<State, Seal>where Seal: UnwindSafe, State: UnwindSafe, <State as ExposedState>::Confidential: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> VerifyEq for Twhere T: Eq,

source§

fn verify_eq(&self, other: &T) -> bool

Verifies commit-equivalence of two instances of the same type.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,