pub struct Msg {
pub header: Header,
pub parent_header: Option<Header>,
pub content: Content,
}Fields§
§header: HeaderInformation associated with this message
parent_header: Option<Header>Information associated with the parent of this message to provide origin context
content: ContentContent within the message
Implementations§
Source§impl Msg
impl Msg
pub fn new(content: Content, parent_header: Option<Header>) -> Self
pub fn to_vec(&self) -> Result<Vec<u8>, MsgError>
pub fn from_slice(slice: &[u8]) -> Result<Self, MsgError>
Sourcepub fn with_parent_header(&mut self, header: Header) -> &mut Self
pub fn with_parent_header(&mut self, header: Header) -> &mut Self
Sets the parent header of this msg with that of the provided header
Sourcepub fn with_parent(&mut self, parent: &Self) -> &mut Self
pub fn with_parent(&mut self, parent: &Self) -> &mut Self
Sets the parent header of this msg with that of the provided parent
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Msg
impl<'de> Deserialize<'de> for Msg
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
impl Eq for Msg
impl StructuralPartialEq for Msg
Auto Trait Implementations§
impl Freeze for Msg
impl RefUnwindSafe for Msg
impl Send for Msg
impl Sync for Msg
impl Unpin for Msg
impl UnsafeUnpin for Msg
impl UnwindSafe for Msg
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.