pub struct IcmpSocket6 { /* private fields */ }Expand description
An Icmpv6 socket.
Implementations§
Source§impl IcmpSocket6
impl IcmpSocket6
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Construct a new raw socket. The socket must be bound to an address using bind_to
before it can be used to send and receive packets.
Sourcepub fn new_dgram_socket() -> Result<Self>
pub fn new_dgram_socket() -> Result<Self>
Construct a new dgram socket. The socket must be bound to an address using bind_to
before it can be used to send and receive packets.
Trait Implementations§
Source§impl IcmpSocket for IcmpSocket6
impl IcmpSocket for IcmpSocket6
Source§type PacketType = Icmpv6Packet
type PacketType = Icmpv6Packet
The type of packet this socket handles.
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn rcv_from(&mut self) -> Result<(Self::PacketType, SockAddr)>
fn rcv_from(&mut self) -> Result<(Self::PacketType, SockAddr)>
Receive a packet on this socket.
Source§fn 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.
fn bind_device(&mut self, interface_name: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for IcmpSocket6
impl RefUnwindSafe for IcmpSocket6
impl Send for IcmpSocket6
impl Sync for IcmpSocket6
impl Unpin for IcmpSocket6
impl UnsafeUnpin for IcmpSocket6
impl UnwindSafe for IcmpSocket6
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