pub struct MessageId(/* private fields */);
Expand description
Message identifier.
Gear allows users and program interactions via messages. Each message has
its own unique 256-bit id. This id is represented via the MessageId
struct. The message identifier can be obtained for the currently processed
message using the gstd::msg::id()
function. Also, each send and reply
functions return a message identifier.
Implementations§
Trait Implementations§
Source§impl<__AsMutT> AsMut<__AsMutT> for MessageId
impl<__AsMutT> AsMut<__AsMutT> for MessageId
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 MessageId
impl Decode for MessageId
Source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<MessageId, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<MessageId, 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 MessageId
impl Encode for MessageId
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 MessageId
impl MaxEncodedLen for MessageId
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 MessageIdExt for MessageId
impl MessageIdExt for MessageId
Source§fn generate_from_user(
block_number: u32,
user_id: ProgramId,
local_nonce: u128,
) -> MessageId
fn generate_from_user( block_number: u32, user_id: ProgramId, local_nonce: u128, ) -> MessageId
Generates
MessageId
for non-program outgoing message.Source§fn generate_outgoing(origin_msg_id: MessageId, local_nonce: u32) -> MessageId
fn generate_outgoing(origin_msg_id: MessageId, local_nonce: u32) -> MessageId
Generates
MessageId
for program outgoing message.Source§fn generate_reply(origin_msg_id: MessageId) -> MessageId
fn generate_reply(origin_msg_id: MessageId) -> MessageId
Generates
MessageId
for reply message depend on status code. Read moreSource§fn generate_signal(origin_msg_id: MessageId) -> MessageId
fn generate_signal(origin_msg_id: MessageId) -> MessageId
Generates
MessageId
for signal message depend on status code.Source§impl Ord for MessageId
impl Ord for MessageId
Source§impl PartialOrd for MessageId
impl PartialOrd for MessageId
impl Copy for MessageId
impl EncodeLike for MessageId
impl Eq for MessageId
impl StructuralPartialEq for MessageId
Auto Trait Implementations§
impl Freeze for MessageId
impl RefUnwindSafe for MessageId
impl Send for MessageId
impl Sync for MessageId
impl Unpin for MessageId
impl UnwindSafe for MessageId
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
)