pub struct Message { /* private fields */ }
Expand description
An entity that is used for interaction between actors. Can transfer value and executes by programs in corresponding function: init, handle or handle_reply.
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(
id: MessageId,
source: ProgramId,
destination: ProgramId,
payload: Payload,
gas_limit: Option<GasLimit>,
value: Value,
details: Option<MessageDetails>,
) -> Self
pub fn new( id: MessageId, source: ProgramId, destination: ProgramId, payload: Payload, gas_limit: Option<GasLimit>, value: Value, details: Option<MessageDetails>, ) -> Self
Create new message.
Sourcepub fn into_parts(
self,
) -> (MessageId, ProgramId, ProgramId, Payload, Option<GasLimit>, Value, Option<MessageDetails>)
pub fn into_parts( self, ) -> (MessageId, ProgramId, ProgramId, Payload, Option<GasLimit>, Value, Option<MessageDetails>)
Into parts.
Sourcepub fn into_stored(self) -> StoredMessage
pub fn into_stored(self) -> StoredMessage
Convert Message into gasless StoredMessage.
Sourcepub fn destination(&self) -> ProgramId
pub fn destination(&self) -> ProgramId
Message destination.
Sourcepub fn payload_bytes(&self) -> &[u8]
pub fn payload_bytes(&self) -> &[u8]
Message payload bytes.
Sourcepub fn reply_details(&self) -> Option<ReplyDetails>
pub fn reply_details(&self) -> Option<ReplyDetails>
Message reply.
Sourcepub fn signal_details(&self) -> Option<SignalDetails>
pub fn signal_details(&self) -> Option<SignalDetails>
Message signal.
Sourcepub fn is_error_reply(&self) -> bool
pub fn is_error_reply(&self) -> bool
Returns bool defining if message is error reply.
Trait Implementations§
Source§impl Decode for Message
impl Decode for Message
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
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 Message
impl Encode for Message
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: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
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 From<Message> for StoredMessage
impl From<Message> for StoredMessage
Source§fn from(message: Message) -> StoredMessage
fn from(message: Message) -> StoredMessage
Converts to this type from the input type.
Source§impl Ord for Message
impl Ord for Message
Source§impl PartialOrd for Message
impl PartialOrd for Message
impl EncodeLike for Message
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
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