Struct icmp_socket::socket::IcmpSocket4
source · [−]pub struct IcmpSocket4 { /* private fields */ }
Expand description
An ICMPv4 socket.
Implementations
sourceimpl IcmpSocket4
impl IcmpSocket4
Trait Implementations
sourceimpl IcmpSocket for IcmpSocket4
impl IcmpSocket for IcmpSocket4
type PacketType = Icmpv4Packet
type PacketType = Icmpv4Packet
The type of packet this socket handles.
sourcefn set_max_hops(&mut self, hops: u32)
fn set_max_hops(&mut self, hops: u32)
Sets the ttl for packets sent on this socket. Controls the number of hops the packet will be allowed to traverse. Read more
sourcefn bind<A: Into<Self::AddrType>>(&mut self, addr: A) -> Result<()>
fn bind<A: Into<Self::AddrType>>(&mut self, addr: A) -> Result<()>
Binds this socket to an address.
sourcefn send_to(
&mut self,
dest: Self::AddrType,
packet: Self::PacketType
) -> Result<()>
fn send_to(
&mut self,
dest: Self::AddrType,
packet: Self::PacketType
) -> Result<()>
Sends the packet to the given destination.
sourcefn rcv_from(&mut self) -> Result<(Self::PacketType, SockAddr)>
fn rcv_from(&mut self) -> Result<(Self::PacketType, SockAddr)>
Receive a packet on this socket.
sourcefn set_timeout(&mut self, timeout: Option<Duration>)
fn set_timeout(&mut self, timeout: Option<Duration>)
Sets the timeout on the socket for rcv_from. A value of None will cause rcv_from to block. Read more
Auto Trait Implementations
impl RefUnwindSafe for IcmpSocket4
impl Send for IcmpSocket4
impl Sync for IcmpSocket4
impl Unpin for IcmpSocket4
impl UnwindSafe for IcmpSocket4
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more