Enum rgb_node::util::MagicNumber[][src]

#[repr(u32)]
#[non_exhaustive]pub enum MagicNumber {
    Schema,
    Genesis,
    Transition,
    Extension,
    Anchor,
    Consignment,
    Disclosure,
    Stash,
}

Magic numbers here are used to distinguish files with RGB data of different type.

NB: These numbers are used with binary data serialization only; they are not a part of the commitments, ids or network-serialized packets.

Rationale: convenience for wallet data import/export and extra-wallet file storage; additional check not to mis-interpret byte sequences

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Schema

Equals to first 4 bytes of SHA256(“rgb:schema”) = 18429ce35af7f898f765417b28471ab454b89ceff6fc33de77ff5fd98e066bc3 Check with echo -n "rgb:schema" | shasum -a 256

Genesis

Equals to first 4 bytes of SHA256(“rgb:gensis”) = 2e91cbc08b6205efb4f908bb9bd3fcf5c148763f7b23b0506ef64ffd414fc9b4

Transition

Equals to first 4 bytes of SHA256(“rgb:transition”) = bf11926e3db131632bdfa8f996d52d6d19e25d0884c922365ff8cd3c73f10198

Extension

Equals to first 4 bytes of SHA256(“rgb:extension”) = 296c892df8b4231058b9ea8b55e0bf6a08069e4fea700a570c535de2d9f39e45

Anchor

Equals to first 4 bytes of SHA256(“rgb:anchor”) = dd53b6f17c16915ecd01de7935b5c38497f6f6c49b97627296496dc31a6ca86b

Consignment

Equals to first 4 bytes of SHA256(“rgb:consignment”) = 4c82bf5385ab9027f15f1ce17a8007956fe8f38cbad2ee312cf2c55b72a69420

Disclosure

Equals to first 4 bytes of SHA256(“rgb:disclosure”) = e2fde682700fcef51e2dd3ef8e1c76340881e3ddfd81e9c45c54cf92b5b9483f

Stash

Equals to first 4 bytes of SHA256(“rgb:stash”) = cd22a2cb85720d51f1616752cb85059a02f3d35f7dda30a4ca981b59b0924354

Implementations

impl MagicNumber[src]

pub fn to_u32(&self) -> u32[src]

Trait Implementations

impl Clone for MagicNumber[src]

impl Copy for MagicNumber[src]

impl Debug for MagicNumber[src]

impl Display for MagicNumber[src]

impl Eq for MagicNumber[src]

impl PartialEq<MagicNumber> for MagicNumber[src]

impl StructuralEq for MagicNumber[src]

impl StructuralPartialEq for MagicNumber[src]

impl TryFrom<u32> for MagicNumber[src]

type Error = u32

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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