pub enum Socket<'a> {
Raw(RawSocket<'a>),
Icmp(IcmpSocket<'a>),
Udp(UdpSocket<'a>),
Tcp(TcpSocket<'a>),
Dhcpv4(Dhcpv4Socket),
}
Expand description
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>)
Icmp(IcmpSocket<'a>)
Udp(UdpSocket<'a>)
Tcp(TcpSocket<'a>)
Dhcpv4(Dhcpv4Socket)
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Socket<'a>
impl<'a> Send for Socket<'a>
impl<'a> Sync for Socket<'a>
impl<'a> Unpin for Socket<'a>
impl<'a> !UnwindSafe for Socket<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more