[][src]Struct exonum::messages::Signed

pub struct Signed<T> { /* fields omitted */ }

Wraps a Payload together with the corresponding SignedMessage.

Usually one wants to work with fully parsed messages (i.e., Payload). However, occasionally we need to retransmit the message into the network or save its serialized form. We could serialize the Payload back, but Protobuf does not have a canonical form so the resulting payload may have different binary representation (thus invalidating the message signature).

So we use Signed to keep the original byte buffer around with the parsed Payload.

Methods

impl<T: ProtocolMessage> Signed<T>[src]

pub fn hash(&self) -> Hash[src]

Returns hash of the full message.

pub fn serialize(self) -> Vec<u8>[src]

Returns a serialized buffer.

pub fn payload(&self) -> &T[src]

Returns reference to the payload.

pub fn signed_message(&self) -> &SignedMessage[src]

Returns reference to the signed message.

pub fn author(&self) -> PublicKey[src]

Returns public key of the message creator.

Trait Implementations

impl VoteMessage for Signed<Precommit>[src]

impl VoteMessage for Signed<Prevote>[src]

impl<T: ProtocolMessage> StorageValue for Signed<T>[src]

impl<T: PartialOrd> PartialOrd<Signed<T>> for Signed<T>[src]

impl<T: ProtocolMessage> AsRef<T> for Signed<T>[src]

impl<T: PartialEq> PartialEq<Signed<T>> for Signed<T>[src]

impl<T: ProtocolMessage> From<Signed<T>> for Message[src]

impl<T: Clone> Clone for Signed<T>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Ord> Ord for Signed<T>[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<T: Eq> Eq for Signed<T>[src]

impl<T: Debug> Debug for Signed<T>[src]

impl<T: ProtocolMessage> Deref for Signed<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> Serialize for Signed<T>[src]

impl<'de, T> Deserialize<'de> for Signed<T> where
    T: ProtocolMessage, 
[src]

impl<T: ProtocolMessage> CryptoHash for Signed<T>[src]

impl<T> ToHex for Signed<T>[src]

impl<X: ProtocolMessage> FromHex for Signed<X>[src]

type Error = Error

Auto Trait Implementations

impl<T> Send for Signed<T> where
    T: Send

impl<T> Sync for Signed<T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

impl<T> Erased for T

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]