[−][src]Struct exonum::messages::Signed
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]
fn validator(&self) -> ValidatorId
[src]
impl VoteMessage for Signed<Prevote>
[src]
fn validator(&self) -> ValidatorId
[src]
impl<T: ProtocolMessage> StorageValue for Signed<T>
[src]
fn into_bytes(self) -> Vec<u8>
[src]
fn from_bytes(value: Cow<[u8]>) -> Self
[src]
impl<T: PartialOrd> PartialOrd<Signed<T>> for Signed<T>
[src]
fn partial_cmp(&self, other: &Signed<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Signed<T>) -> bool
[src]
fn le(&self, other: &Signed<T>) -> bool
[src]
fn gt(&self, other: &Signed<T>) -> bool
[src]
fn ge(&self, other: &Signed<T>) -> bool
[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(&self) -> 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 cmp(&self, other: &Signed<T>) -> Ordering
[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]
impl<T> Serialize for Signed<T>
[src]
impl<'de, T> Deserialize<'de> for Signed<T> where
T: ProtocolMessage,
[src]
T: ProtocolMessage,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<T: ProtocolMessage> CryptoHash for Signed<T>
[src]
impl<T> ToHex for Signed<T>
[src]
fn write_hex<W: Write>(&self, w: &mut W) -> Result
[src]
fn write_hex_upper<W: Write>(&self, w: &mut W) -> Result
[src]
impl<X: ProtocolMessage> FromHex for Signed<X>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn write_hex<W>(&self, w: &mut W) -> Result<(), Error> where
W: Write,
[src]
W: Write,
fn write_hex_upper<W>(&self, w: &mut W) -> Result<(), Error> where
W: Write,
[src]
W: Write,
impl<T> Erased for T
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,