pub struct ActorId(/* private fields */);
Expand description
Program (actor) identifier.
Gear allows user and program interactions via messages. Source and target
program as well as user are represented by 256-bit identifier ActorId
struct. The source ActorId
for a message being processed can be obtained
using gstd::msg::source()
function. Also, each send function has a target
ActorId
as one of the arguments.
Implementations§
Source§impl ActorId
impl ActorId
Sourcepub fn to_ss58check(&self) -> Result<Ss58Address, ConversionError>
pub fn to_ss58check(&self) -> Result<Ss58Address, ConversionError>
Returns the ss58-check address with default ss58 version.
Sourcepub fn to_ss58check_with_version(
&self,
version: u16,
) -> Result<Ss58Address, ConversionError>
pub fn to_ss58check_with_version( &self, version: u16, ) -> Result<Ss58Address, ConversionError>
Returns the ss58-check address with given ss58 version.
Sourcepub fn to_address_lossy(&self) -> H160
pub fn to_address_lossy(&self) -> H160
Returns H160
with possible loss of the first 12 bytes.
Trait Implementations§
Source§impl ActorIdExt for ActorId
impl ActorIdExt for ActorId
Source§fn generate_from_user(code_id: CodeId, salt: &[u8]) -> Self
fn generate_from_user(code_id: CodeId, salt: &[u8]) -> Self
Generates
ActorId
from given CodeId
and salt
.Source§impl<__AsMutT> AsMut<__AsMutT> for ActorId
impl<__AsMutT> AsMut<__AsMutT> for ActorId
Source§fn as_mut(&mut self) -> &mut __AsMutT
fn as_mut(&mut self) -> &mut __AsMutT
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl Decode for ActorId
impl Decode for ActorId
Source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<ActorId, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<ActorId, Error>where
__CodecInputEdqy: Input,
Attempt to deserialise the value from input.
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§impl Encode for ActorId
impl Encode for ActorId
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl MaxEncodedLen for ActorId
impl MaxEncodedLen for ActorId
Source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
Source§impl Ord for ActorId
impl Ord for ActorId
Source§impl PartialOrd for ActorId
impl PartialOrd for ActorId
impl Copy for ActorId
impl EncodeLike for ActorId
impl Eq for ActorId
impl StructuralPartialEq for ActorId
Auto Trait Implementations§
impl Freeze for ActorId
impl RefUnwindSafe for ActorId
impl Send for ActorId
impl Sync for ActorId
impl Unpin for ActorId
impl UnwindSafe for ActorId
Blanket Implementations§
Source§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8]
Source§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8]
Source§impl<U> AsMutSliceOf for U
impl<U> AsMutSliceOf for U
fn as_mut_slice_of<T>(&mut self) -> Result<&mut [T], Error>where
T: FromByteSlice,
Source§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
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
)