Struct webb_proposals::ProposalHeader
source · pub struct ProposalHeader {
pub resource_id: ResourceId,
pub function_signature: FunctionSignature,
pub nonce: Nonce,
}Expand description
Proposal Header (40 bytes).
┌────────────────────┬─────────────────┬───────────────┐
│ │ │ │
│ Resource ID 32B │ Function Sig 4B │ Nonce 4B │
│ │ │ │
└────────────────────┴─────────────────┴───────────────┘
Fields§
§resource_id: ResourceIdResource ID of the execution context
function_signature: FunctionSignatureFunction signature / identifier
nonce: NonceNonce for proposal execution
Implementations§
source§impl ProposalHeader
impl ProposalHeader
sourcepub const fn new(
resource_id: ResourceId,
function_signature: FunctionSignature,
nonce: Nonce
) -> Self
pub const fn new( resource_id: ResourceId, function_signature: FunctionSignature, nonce: Nonce ) -> Self
Create a new ProposalHeader.
sourcepub fn resource_id(&self) -> ResourceId
pub fn resource_id(&self) -> ResourceId
Get the ResourceId from the ProposalHeader.
sourcepub fn function_signature(&self) -> FunctionSignature
pub fn function_signature(&self) -> FunctionSignature
Get the FunctionSignature from the ProposalHeader.
sourcepub fn into_bytes(self) -> [u8; 40]
pub fn into_bytes(self) -> [u8; 40]
Get the underlying bytes of the ProposalHeader without copying.
Trait Implementations§
source§impl Clone for ProposalHeader
impl Clone for ProposalHeader
source§fn clone(&self) -> ProposalHeader
fn clone(&self) -> ProposalHeader
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 ProposalHeader
impl Debug for ProposalHeader
source§impl Decode for ProposalHeader
impl Decode for ProposalHeader
source§fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
Attempt to deserialise the value from input.
source§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
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<'de> Deserialize<'de> for ProposalHeader
impl<'de> Deserialize<'de> for ProposalHeader
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode for ProposalHeader
impl Encode for ProposalHeader
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<T: Output + ?Sized>(&self, dest: &mut T)
fn encode_to<T: Output + ?Sized>(&self, dest: &mut T)
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<ProposalHeader> for [u8; 40]
impl From<ProposalHeader> for [u8; 40]
source§fn from(header: ProposalHeader) -> Self
fn from(header: ProposalHeader) -> Self
Converts to this type from the input type.
source§impl Hash for ProposalHeader
impl Hash for ProposalHeader
source§impl Ord for ProposalHeader
impl Ord for ProposalHeader
source§fn cmp(&self, other: &ProposalHeader) -> Ordering
fn cmp(&self, other: &ProposalHeader) -> 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 ProposalHeader
impl PartialEq for ProposalHeader
source§fn eq(&self, other: &ProposalHeader) -> bool
fn eq(&self, other: &ProposalHeader) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for ProposalHeader
impl PartialOrd for ProposalHeader
source§fn partial_cmp(&self, other: &ProposalHeader) -> Option<Ordering>
fn partial_cmp(&self, other: &ProposalHeader) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for ProposalHeader
impl Serialize for ProposalHeader
impl Copy for ProposalHeader
impl Eq for ProposalHeader
impl StructuralEq for ProposalHeader
impl StructuralPartialEq for ProposalHeader
Auto Trait Implementations§
impl RefUnwindSafe for ProposalHeader
impl Send for ProposalHeader
impl Sync for ProposalHeader
impl Unpin for ProposalHeader
impl UnwindSafe for ProposalHeader
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<T> DefensiveMax<T> for Twhere
T: PartialOrd,
impl<T> DefensiveMax<T> for Twhere
T: PartialOrd,
source§fn defensive_max(self, other: T) -> T
fn defensive_max(self, other: T) -> T
source§fn defensive_strict_max(self, other: T) -> T
fn defensive_strict_max(self, other: T) -> T
source§impl<T> DefensiveMin<T> for Twhere
T: PartialOrd,
impl<T> DefensiveMin<T> for Twhere
T: PartialOrd,
source§fn defensive_min(self, other: T) -> T
fn defensive_min(self, other: T) -> T
source§fn defensive_strict_min(self, other: T) -> T
fn defensive_strict_min(self, other: T) -> T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.