Struct piecrust::ContractId
source · #[repr(C)]pub struct ContractId(/* private fields */);Expand description
ID to identify the wasm contracts after they have been deployed
Implementations§
source§impl ContractId
impl ContractId
sourcepub const fn uninitialized() -> ContractId
pub const fn uninitialized() -> ContractId
Creates a placeholder ContractId until the host deploys the contract
and sets a real ContractId. This can also be used to determine if a
contract is the first to be called.
sourcepub const fn from_bytes(bytes: [u8; 32]) -> ContractId
pub const fn from_bytes(bytes: [u8; 32]) -> ContractId
Creates a new ContractId from an array of bytes
sourcepub const fn to_bytes(self) -> [u8; 32]
pub const fn to_bytes(self) -> [u8; 32]
Returns the array of bytes that make up the ContractId
sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Returns a reference to the array of bytes that make up the
ContractId
sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Returns a mutable reference to the array of bytes that make up the
ContractId
sourcepub fn is_uninitialized(&self) -> bool
pub fn is_uninitialized(&self) -> bool
Determines whether the ContractId is uninitialized, which can be
used to check if this contract is the first to be called.
Trait Implementations§
source§impl Archive for ContractId
impl Archive for ContractId
§type Archived = ContractId
type Archived = ContractId
The archived representation of this type. Read more
§type Resolver = ContractIdResolver
type Resolver = ContractIdResolver
The resolver for this type. It must contain all the additional information from serializing
needed to make the archived type from the normal type.
source§impl AsMut<[u8]> for ContractId
impl AsMut<[u8]> for ContractId
source§impl AsRef<[u8]> for ContractId
impl AsRef<[u8]> for ContractId
source§impl<__C> CheckBytes<__C> for ContractId
impl<__C> CheckBytes<__C> for ContractId
§type Error = TupleStructCheckError
type Error = TupleStructCheckError
The error that may result from checking the type.
source§unsafe fn check_bytes<'__bytecheck>(
value: *const ContractId,
context: &mut __C
) -> Result<&'__bytecheck ContractId, TupleStructCheckError>
unsafe fn check_bytes<'__bytecheck>( value: *const ContractId, context: &mut __C ) -> Result<&'__bytecheck ContractId, TupleStructCheckError>
Checks whether the given pointer points to a valid value within the
given context. Read more
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<__D> Deserialize<ContractId, __D> for <ContractId as Archive>::Archived
impl<__D> Deserialize<ContractId, __D> for <ContractId as Archive>::Archived
source§fn deserialize(
&self,
deserializer: &mut __D
) -> Result<ContractId, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D ) -> Result<ContractId, <__D as Fallible>::Error>
Deserializes using the given deserializer
source§impl Display for ContractId
impl Display for ContractId
source§impl Hash for ContractId
impl Hash 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 for ContractId
impl PartialEq for ContractId
source§fn eq(&self, other: &ContractId) -> bool
fn eq(&self, other: &ContractId) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for ContractId
impl PartialOrd for ContractId
source§fn partial_cmp(&self, other: &ContractId) -> Option<Ordering>
fn partial_cmp(&self, other: &ContractId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl<__S> Serialize<__S> for ContractId
impl<__S> Serialize<__S> for ContractId
impl Copy for ContractId
impl Eq for ContractId
impl StructuralEq for ContractId
impl StructuralPartialEq for ContractId
Auto Trait Implementations§
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> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata )
Creates the archived version of the metadata for this value at the given position and writes
it to the given output. Read more
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, S> SerializeUnsized<S> for T
impl<T, S> SerializeUnsized<S> for T
source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)