pub struct IncomingDispatch { /* private fields */ }
Expand description
Incoming message with entry point and previous execution context, if exists.
Implementations§
Source§impl IncomingDispatch
impl IncomingDispatch
Sourcepub fn new(
kind: DispatchKind,
message: IncomingMessage,
context: Option<ContextStore>,
) -> Self
pub fn new( kind: DispatchKind, message: IncomingMessage, context: Option<ContextStore>, ) -> Self
Create new IncomingDispatch.
Sourcepub fn into_stored(
self,
destination: ProgramId,
context: ContextStore,
) -> StoredDispatch
pub fn into_stored( self, destination: ProgramId, context: ContextStore, ) -> StoredDispatch
Convert IncomingDispatch into gasless StoredDispatch with updated (or recently set) context.
Sourcepub fn into_parts(self) -> (DispatchKind, IncomingMessage, Option<ContextStore>)
pub fn into_parts(self) -> (DispatchKind, IncomingMessage, Option<ContextStore>)
Decompose IncomingDispatch for it’s components: DispatchKind, IncomingMessage and Option<ContextStore>
.
Sourcepub fn kind(&self) -> DispatchKind
pub fn kind(&self) -> DispatchKind
Entry point for the message.
Sourcepub fn message(&self) -> &IncomingMessage
pub fn message(&self) -> &IncomingMessage
Dispatch message reference.
Sourcepub fn context(&self) -> &Option<ContextStore>
pub fn context(&self) -> &Option<ContextStore>
Previous execution context reference, if exists.
Sourcepub fn context_mut(&mut self) -> &mut Option<ContextStore>
pub fn context_mut(&mut self) -> &mut Option<ContextStore>
Previous execution context mutable reference, if exists.
Methods from Deref<Target = IncomingMessage>§
Sourcepub fn payload_bytes(&self) -> &[u8]
pub fn payload_bytes(&self) -> &[u8]
Message payload bytes.
Sourcepub fn details(&self) -> Option<MessageDetails>
pub fn details(&self) -> Option<MessageDetails>
Message details.
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 Clone for IncomingDispatch
impl Clone for IncomingDispatch
Source§fn clone(&self) -> IncomingDispatch
fn clone(&self) -> IncomingDispatch
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for IncomingDispatch
impl Debug for IncomingDispatch
Source§impl Decode for IncomingDispatch
impl Decode for IncomingDispatch
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 Default for IncomingDispatch
impl Default for IncomingDispatch
Source§fn default() -> IncomingDispatch
fn default() -> IncomingDispatch
Returns the “default value” for a type. Read more
Source§impl Deref for IncomingDispatch
impl Deref for IncomingDispatch
Source§impl Encode for IncomingDispatch
impl Encode for IncomingDispatch
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<IncomingDispatch> for (DispatchKind, IncomingMessage, Option<ContextStore>)
impl From<IncomingDispatch> for (DispatchKind, IncomingMessage, Option<ContextStore>)
Source§fn from(
dispatch: IncomingDispatch,
) -> (DispatchKind, IncomingMessage, Option<ContextStore>)
fn from( dispatch: IncomingDispatch, ) -> (DispatchKind, IncomingMessage, Option<ContextStore>)
Converts to this type from the input type.
Source§impl Hash for IncomingDispatch
impl Hash for IncomingDispatch
Source§impl Ord for IncomingDispatch
impl Ord for IncomingDispatch
Source§fn cmp(&self, other: &IncomingDispatch) -> Ordering
fn cmp(&self, other: &IncomingDispatch) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for IncomingDispatch
impl PartialEq for IncomingDispatch
Source§impl PartialOrd for IncomingDispatch
impl PartialOrd for IncomingDispatch
Source§impl TypeInfo for IncomingDispatch
impl TypeInfo for IncomingDispatch
impl EncodeLike for IncomingDispatch
impl Eq for IncomingDispatch
impl StructuralPartialEq for IncomingDispatch
Auto Trait Implementations§
impl Freeze for IncomingDispatch
impl RefUnwindSafe for IncomingDispatch
impl Send for IncomingDispatch
impl Sync for IncomingDispatch
impl Unpin for IncomingDispatch
impl UnwindSafe for IncomingDispatch
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