smoltcp::socket

Trait AnySocket

Source
pub trait AnySocket<'a> {
    // Required methods
    fn upcast(self) -> Socket<'a>;
    fn downcast<'c>(socket: &'c Socket<'a>) -> Option<&'c Self>
       where Self: Sized;
    fn downcast_mut<'c>(socket: &'c mut Socket<'a>) -> Option<&'c mut Self>
       where Self: Sized;
}
Expand description

A conversion trait for network sockets.

Required Methods§

Source

fn upcast(self) -> Socket<'a>

Source

fn downcast<'c>(socket: &'c Socket<'a>) -> Option<&'c Self>
where Self: Sized,

Source

fn downcast_mut<'c>(socket: &'c mut Socket<'a>) -> Option<&'c mut Self>
where Self: Sized,

Implementors§

Source§

impl<'a> AnySocket<'a> for smoltcp::socket::dhcpv4::Socket<'a>

Source§

impl<'a> AnySocket<'a> for smoltcp::socket::dns::Socket<'a>

Source§

impl<'a> AnySocket<'a> for smoltcp::socket::tcp::Socket<'a>