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§
§impl ActorId
impl ActorId
pub fn into_bytes(self) -> [u8; 32]
pub fn into_bytes(self) -> [u8; 32]
Returns ActorId
as bytes array.
§impl ActorId
impl ActorId
pub fn to_ss58check(&self) -> Result<Ss58Address, ConversionError>
pub fn to_ss58check(&self) -> Result<Ss58Address, ConversionError>
Returns the ss58-check address with default ss58 version.
pub 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.
pub 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§
§impl<__AsMutT> AsMut<__AsMutT> for ActorId
impl<__AsMutT> AsMut<__AsMutT> for ActorId
§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.
§impl Decode for ActorId
impl Decode for ActorId
§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.
§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
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
§impl Encode for ActorId
impl Encode for ActorId
§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
Convert self to a slice and append it to the destination.
§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.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
§impl MaxEncodedLen for ActorId
impl MaxEncodedLen for ActorId
§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
§impl Ord for ActorId
impl Ord for ActorId
§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§
§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8]
§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8]
§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,
§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§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<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
§fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>
fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>
Return an encoding of
Self
prepended by given slice.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
)