pub struct Message {
pub tag: Tag,
pub body: Vec<u8>,
/* private fields */
}Expand description
A struct containing a tag and associated bytes
Fields§
§tag: TagA tag
body: Vec<u8>A vector of bytes
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(tag: u128, body: Vec<u8>) -> Result<Self, Error>
pub fn new(tag: u128, body: Vec<u8>) -> Result<Self, Error>
Constructs a Message struct. Throws an error if tag is zero, tag exceeds 2^127 - 1, or byte count exceeds 2^32 - 1.
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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