Struct SockRef
struct SockRef<'s> { ... }
A reference to a Socket that can be used to configure socket types other
than the Socket type itself.
This allows for example a TcpStream, found in the standard library, to
be configured using all the additional methods found in the Socket API.
SockRef can be created from any socket type that implements AsFd
(Unix) or AsSocket (Windows) using the From implementation.
Examples
Below is an example of converting a TcpStream into a SockRef.
use ;
use SockRef;
#
Implementations
impl Debug for SockRef<'_>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<'s> Deref for SockRef<'s>
fn deref(self: &Self) -> &<Self as >::Target
impl<'s> Freeze for SockRef<'s>
impl<'s> RefUnwindSafe for SockRef<'s>
impl<'s> Send for SockRef<'s>
impl<'s> Sync for SockRef<'s>
impl<'s> Unpin for SockRef<'s>
impl<'s> UnsafeUnpin for SockRef<'s>
impl<'s> UnwindSafe for SockRef<'s>
impl<'s, S> From for SockRef<'s>
fn from(socket: &'s S) -> SelfThe caller must ensure
Sis actually a socket.
impl<P, T> Receiver for SockRef<'s>
impl<T> Any for SockRef<'s>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for SockRef<'s>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for SockRef<'s>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for SockRef<'s>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for SockRef<'s>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for SockRef<'s>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for SockRef<'s>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>