[][src]Enum smoltcp::socket::Socket

pub enum Socket<'a, 'b: 'a> {
    Raw(RawSocket<'a, 'b>),
    Icmp(IcmpSocket<'a, 'b>),
    Udp(UdpSocket<'a, 'b>),
    Tcp(TcpSocket<'a>),
    // some variants omitted
}

A network socket.

This enumeration abstracts the various types of sockets based on the IP protocol. To downcast a Socket value to a concrete socket, use the AnySocket trait, e.g. to get UdpSocket, call UdpSocket::downcast(socket).

It is usually more convenient to use SocketSet::get instead.

Variants

Raw(RawSocket<'a, 'b>)
Icmp(IcmpSocket<'a, 'b>)
Udp(UdpSocket<'a, 'b>)
Tcp(TcpSocket<'a>)

Methods

impl<'a, 'b> Socket<'a, 'b>[src]

pub fn handle(&self) -> SocketHandle[src]

Return the socket handle.

Trait Implementations

impl<'a, 'b: 'a> Debug for Socket<'a, 'b>[src]

impl<'a> Into<Socket<'a, 'a>> for TcpSocket<'a>[src]

impl<'a, 'b> Into<Socket<'a, 'b>> for RawSocket<'a, 'b>[src]

impl<'a, 'b> Into<Socket<'a, 'b>> for IcmpSocket<'a, 'b>[src]

impl<'a, 'b> Into<Socket<'a, 'b>> for UdpSocket<'a, 'b>[src]

Auto Trait Implementations

impl<'a, 'b> RefUnwindSafe for Socket<'a, 'b>

impl<'a, 'b> Send for Socket<'a, 'b>

impl<'a, 'b> Sync for Socket<'a, 'b>

impl<'a, 'b> Unpin for Socket<'a, 'b>

impl<'a, 'b> !UnwindSafe for Socket<'a, 'b>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.