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: Clone + IcmpIpExt, M: Clone + IcmpMessage<I>> Clone for IcmpPacketBuilder<I, M>
impl<I: Clone + IcmpIpExt, M: Clone + IcmpMessage<I>> Clone for IcmpPacketBuilder<I, M>
Source§fn clone(&self) -> IcmpPacketBuilder<I, M>
fn clone(&self) -> IcmpPacketBuilder<I, M>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more