pub struct StoredDispatch { /* private fields */ }Expand description
Stored message with entry point and previous execution context, if exists.
Implementations§
Source§impl StoredDispatch
impl StoredDispatch
Sourcepub fn new(
kind: DispatchKind,
message: StoredMessage,
context: Option<ContextStore>,
) -> Self
pub fn new( kind: DispatchKind, message: StoredMessage, context: Option<ContextStore>, ) -> Self
Create new StoredDispatch.
Sourcepub fn into_incoming(self, gas_limit: GasLimit) -> IncomingDispatch
pub fn into_incoming(self, gas_limit: GasLimit) -> IncomingDispatch
Convert StoredDispatch into IncomingDispatch for program processing.
Sourcepub fn into_parts(self) -> (DispatchKind, StoredMessage, Option<ContextStore>)
pub fn into_parts(self) -> (DispatchKind, StoredMessage, Option<ContextStore>)
Decompose StoredDispatch for it’s components: DispatchKind, StoredMessage and Option<ContextStore>.
Sourcepub fn kind(&self) -> DispatchKind
pub fn kind(&self) -> DispatchKind
Entry point for the message.
Sourcepub fn message(&self) -> &StoredMessage
pub fn message(&self) -> &StoredMessage
Dispatch message reference.
Sourcepub fn context(&self) -> &Option<ContextStore>
pub fn context(&self) -> &Option<ContextStore>
Previous execution context reference, if exists.
Methods from Deref<Target = StoredMessage>§
Sourcepub fn destination(&self) -> ActorId
pub fn destination(&self) -> ActorId
Message destination.
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 reply_details(&self) -> Option<ReplyDetails>
pub fn reply_details(&self) -> Option<ReplyDetails>
Message reply.
Sourcepub fn is_error_reply(&self) -> bool
pub fn is_error_reply(&self) -> bool
Returns bool defining if message is error reply.
Sourcepub fn reply_code(&self) -> Option<ReplyCode>
pub fn reply_code(&self) -> Option<ReplyCode>
Returns ReplyCode of message if reply.
Trait Implementations§
Source§impl Clone for StoredDispatch
impl Clone for StoredDispatch
Source§fn clone(&self) -> StoredDispatch
fn clone(&self) -> StoredDispatch
Returns a duplicate 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 StoredDispatch
impl Debug for StoredDispatch
Source§impl Decode for StoredDispatch
impl Decode for StoredDispatch
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 DecodeAsFields for StoredDispatch
impl DecodeAsFields for StoredDispatch
Source§fn decode_as_fields<'info, R: TypeResolver>(
input: &mut &[u8],
fields: &mut dyn FieldIter<'info, R::TypeId>,
types: &'info R,
) -> Result<Self, Error>
fn decode_as_fields<'info, R: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'info, R::TypeId>, types: &'info R, ) -> Result<Self, Error>
Given some bytes and some fields denoting their structure, attempt to decode.
Source§impl Deref for StoredDispatch
impl Deref for StoredDispatch
Source§impl Encode for StoredDispatch
impl Encode for StoredDispatch
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 EncodeAsFields for StoredDispatch
impl EncodeAsFields for StoredDispatch
Source§fn encode_as_fields_to<ScaleEncodeResolver: TypeResolver>(
&self,
__encode_as_type_fields: &mut dyn FieldIter<'_, ScaleEncodeResolver::TypeId>,
__encode_as_type_types: &ScaleEncodeResolver,
__encode_as_type_out: &mut Vec<u8>,
) -> Result<(), Error>
fn encode_as_fields_to<ScaleEncodeResolver: TypeResolver>( &self, __encode_as_type_fields: &mut dyn FieldIter<'_, ScaleEncodeResolver::TypeId>, __encode_as_type_types: &ScaleEncodeResolver, __encode_as_type_out: &mut Vec<u8>, ) -> Result<(), Error>
Given some fields describing the shape of a type, attempt to encode to that shape.
Source§fn encode_as_fields<R>(
&self,
fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
fn encode_as_fields<R>(
&self,
fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
This is a helper function which internally calls
EncodeAsFields::encode_as_fields_to. Prefer to
implement that instead.Source§impl EncodeAsType for StoredDispatch
impl EncodeAsType for StoredDispatch
Source§fn encode_as_type_to<ScaleEncodeResolver: TypeResolver>(
&self,
__encode_as_type_type_id: ScaleEncodeResolver::TypeId,
__encode_as_type_types: &ScaleEncodeResolver,
__encode_as_type_out: &mut Vec<u8>,
) -> Result<(), Error>
fn encode_as_type_to<ScaleEncodeResolver: TypeResolver>( &self, __encode_as_type_type_id: ScaleEncodeResolver::TypeId, __encode_as_type_types: &ScaleEncodeResolver, __encode_as_type_out: &mut Vec<u8>, ) -> Result<(), Error>
Given some
type_id, types, a context and some output target for the SCALE encoded bytes,
attempt to SCALE encode the current value into the type given by type_id.Source§fn encode_as_type<R>(
&self,
type_id: <R as TypeResolver>::TypeId,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
fn encode_as_type<R>(
&self,
type_id: <R as TypeResolver>::TypeId,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
This is a helper function which internally calls
EncodeAsType::encode_as_type_to. Prefer to
implement that instead.Source§impl From<Dispatch> for StoredDispatch
impl From<Dispatch> for StoredDispatch
Source§fn from(dispatch: Dispatch) -> StoredDispatch
fn from(dispatch: Dispatch) -> StoredDispatch
Converts to this type from the input type.
Source§impl From<StoredDelayedDispatch> for StoredDispatch
impl From<StoredDelayedDispatch> for StoredDispatch
Source§fn from(dispatch: StoredDelayedDispatch) -> Self
fn from(dispatch: StoredDelayedDispatch) -> Self
Converts to this type from the input type.
Source§impl From<StoredDispatch> for (DispatchKind, StoredMessage, Option<ContextStore>)
impl From<StoredDispatch> for (DispatchKind, StoredMessage, Option<ContextStore>)
Source§fn from(
dispatch: StoredDispatch,
) -> (DispatchKind, StoredMessage, Option<ContextStore>)
fn from( dispatch: StoredDispatch, ) -> (DispatchKind, StoredMessage, Option<ContextStore>)
Converts to this type from the input type.
Source§impl Hash for StoredDispatch
impl Hash for StoredDispatch
Source§impl IntoVisitor for StoredDispatch
impl IntoVisitor for StoredDispatch
Source§type AnyVisitor<ScaleDecodeTypeResolver: TypeResolver> = Visitor<ScaleDecodeTypeResolver>
type AnyVisitor<ScaleDecodeTypeResolver: TypeResolver> = Visitor<ScaleDecodeTypeResolver>
The visitor type used to decode SCALE encoded bytes to
Self.Source§fn into_visitor<ScaleDecodeTypeResolver: TypeResolver>() -> Self::AnyVisitor<ScaleDecodeTypeResolver>
fn into_visitor<ScaleDecodeTypeResolver: TypeResolver>() -> Self::AnyVisitor<ScaleDecodeTypeResolver>
A means of obtaining this visitor.
Source§impl PartialEq for StoredDispatch
impl PartialEq for StoredDispatch
Source§impl TypeInfo for StoredDispatch
impl TypeInfo for StoredDispatch
impl EncodeLike for StoredDispatch
impl Eq for StoredDispatch
impl StructuralPartialEq for StoredDispatch
Auto Trait Implementations§
impl Freeze for StoredDispatch
impl RefUnwindSafe for StoredDispatch
impl Send for StoredDispatch
impl Sync for StoredDispatch
impl Unpin for StoredDispatch
impl UnwindSafe for StoredDispatch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodeAsType for Twhere
T: IntoVisitor,
impl<T> DecodeAsType for Twhere
T: IntoVisitor,
fn decode_as_type_maybe_compact<R>(
input: &mut &[u8],
type_id: <R as TypeResolver>::TypeId,
types: &R,
is_compact: bool,
) -> Result<T, Error>where
R: TypeResolver,
Source§fn decode_as_type<R>(
input: &mut &[u8],
type_id: <R as TypeResolver>::TypeId,
types: &R,
) -> Result<Self, Error>where
R: TypeResolver,
fn decode_as_type<R>(
input: &mut &[u8],
type_id: <R as TypeResolver>::TypeId,
types: &R,
) -> Result<Self, Error>where
R: TypeResolver,
Given some input bytes, a
type_id, and type registry, attempt to decode said bytes into
Self. Implementations should modify the &mut reference to the bytes such that any bytes
not used in the course of decoding are still pointed to after decoding is complete.