pub struct Message<'a> {
pub header: Header,
pub body: MessageBody,
pub suffix: TlvSet<'a>,
}Expand description
A PTP version 2 Message.
For more details, see the individual parts, as well as IEEE1588-2019 clause 13
Fields§
§header: HeaderThe header of the message.
body: MessageBodyThe main data in the message body.
suffix: TlvSet<'a>Any extensions sent along with the message.
Implementations§
Source§impl<'a> Message<'a>
impl<'a> Message<'a>
Sourcepub fn serialize(&self, buffer: &mut [u8]) -> Result<usize, Error>
pub fn serialize(&self, buffer: &mut [u8]) -> Result<usize, Error>
Serializes the object into the PTP wire format.
Returns the ammount of buffer used to serialize the message.
§Errors
The function fails when:
- The message total size or any of its dynamically sized parts exceed 2^16 bytes
- The message does not fit into the provided buffer.
Trait Implementations§
impl<'a> Eq for Message<'a>
impl<'a> StructuralPartialEq for Message<'a>
Auto Trait Implementations§
impl<'a> Forget for Message<'a>
impl<'a> Freeze for Message<'a>
impl<'a> Move for Message<'a>
impl<'a> RefUnwindSafe for Message<'a>
impl<'a> Send for Message<'a>
impl<'a> Sync for Message<'a>
impl<'a> Unpin for Message<'a>
impl<'a> UnsafeUnpin for Message<'a>
impl<'a> UnwindSafe for Message<'a>
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