pub struct HandlePacket { /* private fields */ }
Expand description
Handle message packet.
This structure is preparation for future HandleMessage sending. Has no message id.
Implementations§
Source§impl HandlePacket
impl HandlePacket
Sourcepub fn new(destination: ProgramId, payload: Payload, value: Value) -> Self
pub fn new(destination: ProgramId, payload: Payload, value: Value) -> Self
Create new packet without gas.
Sourcepub fn new_with_gas(
destination: ProgramId,
payload: Payload,
gas_limit: GasLimit,
value: Value,
) -> Self
pub fn new_with_gas( destination: ProgramId, payload: Payload, gas_limit: GasLimit, value: Value, ) -> Self
Create new packet with gas.
Sourcepub fn maybe_with_gas(
destination: ProgramId,
payload: Payload,
gas_limit: Option<GasLimit>,
value: Value,
) -> Self
pub fn maybe_with_gas( destination: ProgramId, payload: Payload, gas_limit: Option<GasLimit>, value: Value, ) -> Self
Create new packet with optional gas.
Sourcepub fn destination(&self) -> ProgramId
pub fn destination(&self) -> ProgramId
Packet destination.
Trait Implementations§
Source§impl Clone for HandlePacket
impl Clone for HandlePacket
Source§fn clone(&self) -> HandlePacket
fn clone(&self) -> HandlePacket
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 HandlePacket
impl Debug for HandlePacket
Source§impl Decode for HandlePacket
impl Decode for HandlePacket
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 HandlePacket
impl Default for HandlePacket
Source§fn default() -> HandlePacket
fn default() -> HandlePacket
Returns the “default value” for a type. Read more
Source§impl Encode for HandlePacket
impl Encode for HandlePacket
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 Hash for HandlePacket
impl Hash for HandlePacket
Source§impl Ord for HandlePacket
impl Ord for HandlePacket
Source§fn cmp(&self, other: &HandlePacket) -> Ordering
fn cmp(&self, other: &HandlePacket) -> 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 Packet for HandlePacket
impl Packet for HandlePacket
Source§fn payload_bytes(&self) -> &[u8]
fn payload_bytes(&self) -> &[u8]
Packet payload bytes.
Source§fn payload_len(&self) -> u32
fn payload_len(&self) -> u32
Payload len
Source§fn kind() -> DispatchKind
fn kind() -> DispatchKind
A dispatch kind the will be generated from the packet.
Source§impl PartialEq for HandlePacket
impl PartialEq for HandlePacket
Source§impl PartialOrd for HandlePacket
impl PartialOrd for HandlePacket
Source§impl TypeInfo for HandlePacket
impl TypeInfo for HandlePacket
impl EncodeLike for HandlePacket
impl Eq for HandlePacket
impl StructuralPartialEq for HandlePacket
Auto Trait Implementations§
impl Freeze for HandlePacket
impl RefUnwindSafe for HandlePacket
impl Send for HandlePacket
impl Sync for HandlePacket
impl Unpin for HandlePacket
impl UnwindSafe for HandlePacket
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