Struct piecrust_uplink::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() -> Self
pub const fn uninitialized() -> Self
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]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
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: ?Sized> CheckBytes<__C> for ContractId
impl<__C: ?Sized> 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 Self,
context: &mut __C
) -> Result<&'__bytecheck Self, TupleStructCheckError>
unsafe fn check_bytes<'__bytecheck>( value: *const Self, context: &mut __C ) -> Result<&'__bytecheck Self, 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: Fallible + ?Sized> Deserialize<ContractId, __D> for Archived<ContractId>
impl<__D: Fallible + ?Sized> Deserialize<ContractId, __D> for Archived<ContractId>
source§fn deserialize(&self, deserializer: &mut __D) -> Result<ContractId, __D::Error>
fn deserialize(&self, deserializer: &mut __D) -> Result<ContractId, __D::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 moreimpl Copy for ContractId
impl Eq 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> 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
source§impl<T> CallHasher for T
impl<T> CallHasher for T
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
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.