pub struct IcmpPacketBuilder<I: IcmpIpExt, M: IcmpMessage<I>> { /* private fields */ }
Expand description
A builder for ICMP packets.
Implementations§
Source§impl<I: IcmpIpExt, M: IcmpMessage<I>> IcmpPacketBuilder<I, M>
impl<I: IcmpIpExt, M: IcmpMessage<I>> IcmpPacketBuilder<I, M>
Sourcepub fn new<S: Into<I::Addr>, D: Into<I::Addr>>(
src_ip: S,
dst_ip: D,
code: M::Code,
msg: M,
) -> IcmpPacketBuilder<I, M>
pub fn new<S: Into<I::Addr>, D: Into<I::Addr>>( src_ip: S, dst_ip: D, code: M::Code, msg: M, ) -> IcmpPacketBuilder<I, M>
Construct a new IcmpPacketBuilder
.
Sourcepub fn message_mut(&mut self) -> &mut M
pub fn message_mut(&mut self) -> &mut M
Returns a mutable reference to the message in the ICMP packet.
Sourcepub fn set_src_ip(&mut self, addr: I::Addr)
pub fn set_src_ip(&mut self, addr: I::Addr)
Sets the source IP address of the ICMP packet.
Sourcepub fn set_dst_ip(&mut self, addr: I::Addr)
pub fn set_dst_ip(&mut self, addr: I::Addr)
Sets the destination IP address of the ICMP packet.
Trait Implementations§
Source§impl<I: Debug + IcmpIpExt, M: Debug + IcmpMessage<I>> Debug for IcmpPacketBuilder<I, M>
impl<I: Debug + IcmpIpExt, M: Debug + IcmpMessage<I>> Debug for IcmpPacketBuilder<I, M>
Source§impl<I: IcmpIpExt, M: IcmpMessage<I>> PacketBuilder for IcmpPacketBuilder<I, M>
impl<I: IcmpIpExt, M: IcmpMessage<I>> PacketBuilder for IcmpPacketBuilder<I, M>
Source§impl<I: PartialEq + IcmpIpExt, M: PartialEq + IcmpMessage<I>> PartialEq for IcmpPacketBuilder<I, M>
impl<I: PartialEq + IcmpIpExt, M: PartialEq + IcmpMessage<I>> PartialEq for IcmpPacketBuilder<I, M>
impl<I: IcmpIpExt, M: IcmpMessage<I>> StructuralPartialEq for IcmpPacketBuilder<I, M>
Auto Trait Implementations§
impl<I, M> Freeze for IcmpPacketBuilder<I, M>
impl<I, M> RefUnwindSafe for IcmpPacketBuilder<I, M>
impl<I, M> Send for IcmpPacketBuilder<I, M>
impl<I, M> Sync for IcmpPacketBuilder<I, M>
impl<I, M> Unpin for IcmpPacketBuilder<I, M>
impl<I, M> UnwindSafe for IcmpPacketBuilder<I, M>
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