pub struct Icmpv4MessageBuilder<'a> { /* private fields */ }Expand description
Builds an ICMPv4 common header in caller-owned storage.
Implementations§
Source§impl<'a> Icmpv4MessageBuilder<'a>
impl<'a> Icmpv4MessageBuilder<'a>
Sourcepub fn new(buffer: &'a mut [u8], body_length: usize) -> Self
pub fn new(buffer: &'a mut [u8], body_length: usize) -> Self
Starts a builder for body_length bytes, which are left untouched.
Sourcepub fn message_type(self, value: Icmpv4Type) -> Self
pub fn message_type(self, value: Icmpv4Type) -> Self
Supplies the ICMPv4 message type.
Sourcepub fn build(self) -> Result<Icmpv4MessageMut<'a>, Icmpv4MessageBuildError>
pub fn build(self) -> Result<Icmpv4MessageMut<'a>, Icmpv4MessageBuildError>
Validates all inputs, writes the common header, and computes its complete checksum.
Body bytes and capacity beyond the requested message are preserved. On error, the whole caller-provided buffer is unchanged.
Auto Trait Implementations§
impl<'a> !UnwindSafe for Icmpv4MessageBuilder<'a>
impl<'a> Freeze for Icmpv4MessageBuilder<'a>
impl<'a> RefUnwindSafe for Icmpv4MessageBuilder<'a>
impl<'a> Send for Icmpv4MessageBuilder<'a>
impl<'a> Sync for Icmpv4MessageBuilder<'a>
impl<'a> Unpin for Icmpv4MessageBuilder<'a>
impl<'a> UnsafeUnpin for Icmpv4MessageBuilder<'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