Skip to main content

IcmpSocket6

Struct IcmpSocket6 

Source
pub struct IcmpSocket6 { /* private fields */ }
Expand description

An Icmpv6 socket.

Implementations§

Source§

impl IcmpSocket6

Source

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.

Source

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

Source§

type AddrType = Ipv6Addr

The type of address this socket operates on.
Source§

type PacketType = Icmpv6Packet

The type of packet this socket handles.
Source§

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<()>

Binds this socket to an address.
Source§

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)>

Receive a packet on this socket.
Source§

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.
Source§

fn bind_device(&mut self, interface_name: &str) -> Result<()>

Source§

impl TryFrom<Ipv6Addr> for IcmpSocket6

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(addr: Ipv6Addr) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.