pub struct ContractEntrypointID { /* private fields */ }Expand description
8-byte identifier for a contract method (entrypoint).
Entrypoint IDs uniquely identify which method to invoke on a contract. A contract may use any 8 bytes; the protocol attaches no meaning to them. By default, the SDK derives them from the interface name, the major version of the interface, and the method name:
SHA256(name || "::" || major || "::" || method)[0..8]major is the semver compatibility prefix of the interface version: the
leading components up to and including the first nonzero one ("1" for
"1.4.2", "0.2" for "0.2.7", "0.0.3" for "0.0.3"). Versions that
share it therefore share entrypoint IDs, and the "::" separators keep
distinct (name, major, method) triples from concatenating to the same
preimage.
§Example
For an "ERC20" interface at version "1.0.0", transfer is
SHA256("ERC20::1::transfer")[0..8].
Interface IDs use the same prefix under a domain tag,
SHA256("thruput-interface::" || name || "::" || major)[0..8], so they
never coincide with an entrypoint ID.
Implementations§
Source§impl ContractEntrypointID
impl ContractEntrypointID
Sourcepub const fn from_u64(n: u64) -> ContractEntrypointID
pub const fn from_u64(n: u64) -> ContractEntrypointID
Builds an entrypoint ID from its numeric form, storing n as
the ID’s 8 big-endian bytes.
Sourcepub fn into_u64(self) -> u64
pub fn into_u64(self) -> u64
Returns the numeric form of this ID, reading its 8 bytes as a
big-endian u64. Inverse of Self::from_u64.
Source§impl ContractEntrypointID
impl ContractEntrypointID
pub fn into_inner(self) -> [u8; 8]
pub const fn new(_inner: [u8; 8]) -> ContractEntrypointID
Trait Implementations§
Source§impl AsRef<[u8]> for ContractEntrypointID
impl AsRef<[u8]> for ContractEntrypointID
Source§impl Clone for ContractEntrypointID
impl Clone for ContractEntrypointID
Source§fn clone(&self) -> ContractEntrypointID
fn clone(&self) -> ContractEntrypointID
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CollectAuthHandles for ContractEntrypointID
impl CollectAuthHandles for ContractEntrypointID
fn collect_auth_handles( &self, _out: &mut AuthHandleBuf, ) -> Result<(), FaultString>
Source§impl ConstMaxSize for ContractEntrypointID
impl ConstMaxSize for ContractEntrypointID
Source§impl ConstMaxSize for ContractEntrypointID
impl ConstMaxSize for ContractEntrypointID
Source§impl ContractTypeRefSpec for ContractEntrypointID
impl ContractTypeRefSpec for ContractEntrypointID
Source§const INFO: ContractTypeInfo<'static>
const INFO: ContractTypeInfo<'static>
__THRUPUT_SPEC_ANCHOR_ROOT) and resolved by spec-tool.Source§const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
ContractTypeView::SignedToken’s payload): the type itself by
default, or None for a type-erased payload (the SDK’s Opaque
overrides this).impl Copy for ContractEntrypointID
Source§impl Debug for ContractEntrypointID
impl Debug for ContractEntrypointID
Source§impl Default for ContractEntrypointID
impl Default for ContractEntrypointID
Source§fn default() -> ContractEntrypointID
fn default() -> ContractEntrypointID
Source§impl Deref for ContractEntrypointID
impl Deref for ContractEntrypointID
Source§impl DerefMut for ContractEntrypointID
impl DerefMut for ContractEntrypointID
impl EncodesAs<ContractEntrypointID> for ContractEntrypointID
impl Eq for ContractEntrypointID
Source§impl Hash for ContractEntrypointID
impl Hash for ContractEntrypointID
Source§impl JsonSchema for ContractEntrypointID
Available on crate feature schema only.
impl JsonSchema for ContractEntrypointID
schema only.Source§fn json_schema(_gen: &mut SchemaGenerator) -> Schema
fn json_schema(_gen: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Mintable for ContractEntrypointID
impl Mintable for ContractEntrypointID
fn mint_into_parent( preimage: ContractEntrypointID, _children: &mut ChildNodeBuf, ) -> Self
Source§impl Ord for ContractEntrypointID
impl Ord for ContractEntrypointID
Source§fn cmp(&self, other: &ContractEntrypointID) -> Ordering
fn cmp(&self, other: &ContractEntrypointID) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ContractEntrypointID
impl PartialEq for ContractEntrypointID
Source§impl PartialOrd for ContractEntrypointID
impl PartialOrd for ContractEntrypointID
Source§impl<'_r> ReadXDR<'_r> for ContractEntrypointID
impl<'_r> ReadXDR<'_r> for ContractEntrypointID
Source§fn read_xdr<R>(r: &mut R) -> Result<ContractEntrypointID, ReadError>where
R: Reader<'_r>,
fn read_xdr<R>(r: &mut R) -> Result<ContractEntrypointID, ReadError>where
R: Reader<'_r>,
Source§fn read_xdr_in_place<R, '__xdrs_s>(
r: &mut R,
__xdrs_slot: Slot<'__xdrs_s, ContractEntrypointID>,
) -> Result<Init<'__xdrs_s, ContractEntrypointID>, ReadError>where
R: Reader<'_r>,
fn read_xdr_in_place<R, '__xdrs_s>(
r: &mut R,
__xdrs_slot: Slot<'__xdrs_s, ContractEntrypointID>,
) -> Result<Init<'__xdrs_s, ContractEntrypointID>, ReadError>where
R: Reader<'_r>,
slot, without first building it
on the stack. Read moreSource§impl<'r, 'a> ReadXDR<'r> for &'a ContractEntrypointIDwhere
'r: 'a,
Available on crate feature xdrs only.
impl<'r, 'a> ReadXDR<'r> for &'a ContractEntrypointIDwhere
'r: 'a,
xdrs only.