pub struct CmrMessage {
pub signature: Signature,
pub header: Vec<MessageId>,
pub body: Vec<u8>,
}Expand description
Parsed CMR message.
Fields§
§signature: SignatureSignature line.
header: Vec<MessageId>Routing header IDs, newest to oldest.
body: Vec<u8>Message body.
Implementations§
Source§impl CmrMessage
impl CmrMessage
Sourcepub fn immediate_sender(&self) -> &str
pub fn immediate_sender(&self) -> &str
Returns the immediate sender address.
Sourcepub fn payload_without_signature_line(&self) -> Vec<u8> ⓘ
pub fn payload_without_signature_line(&self) -> Vec<u8> ⓘ
Returns serialized header + body (without signature line).
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns encoded byte length.
Sourcepub fn make_unsigned(&mut self)
pub fn make_unsigned(&mut self)
Removes signature line.
Sourcepub fn sign_with_key(&mut self, key: &[u8])
pub fn sign_with_key(&mut self, key: &[u8])
Signs message with pairwise key.
Sourcepub fn prepend_hop(&mut self, hop: MessageId)
pub fn prepend_hop(&mut self, hop: MessageId)
Prepends a new route hop.
Trait Implementations§
Source§impl Clone for CmrMessage
impl Clone for CmrMessage
Source§fn clone(&self) -> CmrMessage
fn clone(&self) -> CmrMessage
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 CmrMessage
impl Debug for CmrMessage
Source§impl<'de> Deserialize<'de> for CmrMessage
impl<'de> Deserialize<'de> for CmrMessage
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 PartialEq for CmrMessage
impl PartialEq for CmrMessage
Source§impl Serialize for CmrMessage
impl Serialize for CmrMessage
impl Eq for CmrMessage
impl StructuralPartialEq for CmrMessage
Auto Trait Implementations§
impl Freeze for CmrMessage
impl RefUnwindSafe for CmrMessage
impl Send for CmrMessage
impl Sync for CmrMessage
impl Unpin for CmrMessage
impl UnsafeUnpin for CmrMessage
impl UnwindSafe for CmrMessage
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