pub struct MessageDiscriminant { /* private fields */ }Expand description
Used to distinguish message types that are sign by account keys, to avoid an abuse of signed messages as something else.
This prefix must be at the first four bytes of a message body that is signed under this signature scheme.
The scheme is a draft introduced to avoid security issues with the implementation of meta transactions (NEP-366) but will eventually be standardized with NEP-461 that solves the problem more generally.
Trait Implementations§
Source§impl BorshDeserialize for MessageDiscriminant
impl BorshDeserialize for MessageDiscriminant
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for MessageDiscriminant
impl BorshSerialize for MessageDiscriminant
Source§impl Clone for MessageDiscriminant
impl Clone for MessageDiscriminant
Source§fn clone(&self) -> MessageDiscriminant
fn clone(&self) -> MessageDiscriminant
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 MessageDiscriminant
impl Debug for MessageDiscriminant
Source§impl<'de> Deserialize<'de> for MessageDiscriminant
impl<'de> Deserialize<'de> for MessageDiscriminant
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 From<SignableMessageType> for MessageDiscriminant
impl From<SignableMessageType> for MessageDiscriminant
Source§fn from(ty: SignableMessageType) -> Self
fn from(ty: SignableMessageType) -> Self
Converts to this type from the input type.
Source§impl Hash for MessageDiscriminant
impl Hash for MessageDiscriminant
Source§impl Ord for MessageDiscriminant
impl Ord for MessageDiscriminant
Source§fn cmp(&self, other: &MessageDiscriminant) -> Ordering
fn cmp(&self, other: &MessageDiscriminant) -> 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 MessageDiscriminant
impl PartialEq for MessageDiscriminant
Source§impl PartialOrd for MessageDiscriminant
impl PartialOrd for MessageDiscriminant
Source§impl Serialize for MessageDiscriminant
impl Serialize for MessageDiscriminant
impl Copy for MessageDiscriminant
impl Eq for MessageDiscriminant
impl StructuralPartialEq for MessageDiscriminant
Auto Trait Implementations§
impl Freeze for MessageDiscriminant
impl RefUnwindSafe for MessageDiscriminant
impl Send for MessageDiscriminant
impl Sync for MessageDiscriminant
impl Unpin for MessageDiscriminant
impl UnwindSafe for MessageDiscriminant
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