pub struct ContractId(/* private fields */);
Expand description
Unique contract identifier equivalent to the contract genesis commitment
Implementations§
Source§impl ContractId
impl ContractId
pub fn from_slice(slice: impl AsRef<[u8]>) -> Option<ContractId>
Methods from Deref<Target = Array<u8, 32>>§
Sourcepub fn to_vec(&self) -> Vec<T>where
T: Clone,
Available on crate features std
or alloc
only.
pub fn to_vec(&self) -> Vec<T>where
T: Clone,
std
or alloc
only.Returns vector representing internal slice data
Sourcepub fn iter(&self) -> Iter<'_, T>
pub fn iter(&self) -> Iter<'_, T>
Returns an iterator over the array items.
The iterator yields all items from start to end.
Sourcepub fn to_byte_array(&self) -> [u8; LEN]
pub fn to_byte_array(&self) -> [u8; LEN]
Returns a byte array representation stored in the wrapped type.
Trait Implementations§
Source§impl Borrow<[u8]> for ContractId
impl Borrow<[u8]> for ContractId
Source§impl Clone for ContractId
impl Clone for ContractId
Source§fn clone(&self) -> ContractId
fn clone(&self) -> ContractId
Returns a copy 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 ContractId
impl Debug for ContractId
Source§impl Deref for ContractId
impl Deref for ContractId
Source§impl<'de> Deserialize<'de> for ContractId
impl<'de> Deserialize<'de> for ContractId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContractId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContractId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ContractId
impl Display for ContractId
Source§impl From<ProtocolId> for ContractId
impl From<ProtocolId> for ContractId
Source§fn from(id: ProtocolId) -> ContractId
fn from(id: ProtocolId) -> ContractId
Converts to this type from the input type.
Source§impl FromBaid58<32> for ContractId
impl FromBaid58<32> for ContractId
Source§fn from_baid58_str(s: &str) -> Result<Self, Baid58ParseError>
fn from_baid58_str(s: &str) -> Result<Self, Baid58ParseError>
Format of the string Read more
fn check_baid58_chunking(s: &str, prefix_sep: char, suffix_sep: char) -> bool
Source§fn from_baid58_chunked_str(
s: &str,
prefix_sep: char,
suffix_sep: char,
) -> Result<Self, Baid58ParseError>
fn from_baid58_chunked_str( s: &str, prefix_sep: char, suffix_sep: char, ) -> Result<Self, Baid58ParseError>
Safety Read more
Source§fn from_baid58_maybe_chunked_str(
s: &str,
prefix_sep: char,
suffix_sep: char,
) -> Result<Self, Baid58ParseError>
fn from_baid58_maybe_chunked_str( s: &str, prefix_sep: char, suffix_sep: char, ) -> Result<Self, Baid58ParseError>
Safety Read more
fn from_baid58(baid: Baid58<LEN>) -> Result<Self, Baid58HriError>
Source§impl FromHex for ContractId
impl FromHex for ContractId
Source§fn from_byte_iter<I>(iter: I) -> Result<ContractId, Error>
fn from_byte_iter<I>(iter: I) -> Result<ContractId, Error>
Produce an object from a byte iterator
Source§impl FromStr for ContractId
impl FromStr for ContractId
Source§type Err = Baid58ParseError
type Err = Baid58ParseError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<ContractId, <ContractId as FromStr>::Err>
fn from_str(s: &str) -> Result<ContractId, <ContractId as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moreSource§impl Hash for ContractId
impl Hash for ContractId
Source§impl Index<RangeFull> for ContractId
impl Index<RangeFull> for ContractId
Source§impl Index<RangeInclusive<usize>> for ContractId
impl Index<RangeInclusive<usize>> for ContractId
Source§type Output = <Array<u8, 32> as Index<RangeInclusive<usize>>>::Output
type Output = <Array<u8, 32> as Index<RangeInclusive<usize>>>::Output
The returned type after indexing.
Source§fn index(
&self,
index: RangeInclusive<usize>,
) -> &<ContractId as Index<RangeInclusive<usize>>>::Output
fn index( &self, index: RangeInclusive<usize>, ) -> &<ContractId as Index<RangeInclusive<usize>>>::Output
Performs the indexing (
container[index]
) operation. Read moreSource§impl Index<RangeToInclusive<usize>> for ContractId
impl Index<RangeToInclusive<usize>> for ContractId
Source§type Output = <Array<u8, 32> as Index<RangeInclusive<usize>>>::Output
type Output = <Array<u8, 32> as Index<RangeInclusive<usize>>>::Output
The returned type after indexing.
Source§fn index(
&self,
index: RangeToInclusive<usize>,
) -> &<ContractId as Index<RangeToInclusive<usize>>>::Output
fn index( &self, index: RangeToInclusive<usize>, ) -> &<ContractId as Index<RangeToInclusive<usize>>>::Output
Performs the indexing (
container[index]
) operation. Read moreSource§impl Index<usize> for ContractId
impl Index<usize> for ContractId
Source§impl LowerHex for ContractId
impl LowerHex for ContractId
Source§impl Ord for ContractId
impl Ord for ContractId
Source§fn cmp(&self, other: &ContractId) -> Ordering
fn cmp(&self, other: &ContractId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<ContractId> for OpId
impl PartialEq<ContractId> for OpId
Source§impl PartialEq<OpId> for ContractId
impl PartialEq<OpId> for ContractId
Source§impl PartialEq for ContractId
impl PartialEq for ContractId
Source§impl PartialOrd for ContractId
impl PartialOrd for ContractId
Source§impl Serialize for ContractId
impl Serialize for ContractId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 StrictDecode for ContractId
impl StrictDecode for ContractId
fn strict_decode(reader: &mut impl TypedRead) -> Result<ContractId, DecodeError>
fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>
Source§impl StrictDumb for ContractId
impl StrictDumb for ContractId
fn strict_dumb() -> ContractId
Source§impl StrictEncode for ContractId
impl StrictEncode for ContractId
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize, Error>
Source§impl StrictTuple for ContractId
impl StrictTuple for ContractId
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for ContractId
impl StrictType for ContractId
const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB
fn strict_name() -> Option<TypeName>
Source§impl ToBaid58<32> for ContractId
impl ToBaid58<32> for ContractId
Source§impl UpperHex for ContractId
impl UpperHex for ContractId
Source§impl Wrapper for ContractId
impl Wrapper for ContractId
Source§fn from_inner(inner: <ContractId as Wrapper>::Inner) -> ContractId
fn from_inner(inner: <ContractId as Wrapper>::Inner) -> ContractId
Instantiates wrapper type with the inner data
Source§fn as_inner(&self) -> &<ContractId as Wrapper>::Inner
fn as_inner(&self) -> &<ContractId as Wrapper>::Inner
Returns reference to the inner representation for the wrapper type
Source§fn into_inner(self) -> <ContractId as Wrapper>::Inner
fn into_inner(self) -> <ContractId as Wrapper>::Inner
Unwraps the wrapper returning the inner type
impl Copy for ContractId
impl Eq for ContractId
impl StrictProduct for ContractId
impl StructuralPartialEq for ContractId
Auto Trait Implementations§
impl Freeze for ContractId
impl RefUnwindSafe for ContractId
impl Send for ContractId
impl Sync for ContractId
impl Unpin for ContractId
impl UnwindSafe for ContractId
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
Source§impl<Id, const LEN: usize, const REVERSE_STR: bool> ByteArray<LEN> for Id
impl<Id, const LEN: usize, const REVERSE_STR: bool> ByteArray<LEN> for Id
Source§fn from_byte_array(val: impl Into<[u8; LEN]>) -> Id
fn from_byte_array(val: impl Into<[u8; LEN]>) -> Id
Constructs a wrapper type around a byte array.
Source§fn from_slice(slice: impl AsRef<[u8]>) -> Result<Id, FromSliceError>
fn from_slice(slice: impl AsRef<[u8]>) -> Result<Id, FromSliceError>
Constructs a byte array from the slice. Errors if the slice length
doesn’t match
LEN
constant generic.Source§fn from_slice_unsafe(slice: impl AsRef<[u8]>) -> Id
fn from_slice_unsafe(slice: impl AsRef<[u8]>) -> Id
Constructs a byte array from the slice. Expects the slice length
doesn’t match
LEN
constant generic. Read moreSource§fn to_byte_array(&self) -> [u8; LEN]
fn to_byte_array(&self) -> [u8; LEN]
Returns a byte array representation stored in the wrapped type.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.