Struct Protocol
pub struct Protocol(/* private field */);
Protocol specification used for creating sockets via Socket::new.
This is a newtype wrapper around an integer which provides a nicer API in addition to an injection point for documentation.
This type is freely interconvertible with C's int type, however, if a raw
value needs to be provided.
Implementations
impl Protocol
const ICMPV4: Protocol = _;Protocol corresponding to
ICMPv4.const ICMPV6: Protocol = _;Protocol corresponding to
ICMPv6.const TCP: Protocol = _;Protocol corresponding to
TCP.const UDP: Protocol = _;Protocol corresponding to
UDP.const MPTCP: Protocol = _;Protocol corresponding to
MPTCP.const DCCP: Protocol = _;Protocol corresponding to
DCCP.const SCTP: Protocol = _;Protocol corresponding to
SCTP.const UDPLITE: Protocol = _;Protocol corresponding to
UDPLITE.
Trait Implementations
impl Clone for Protocol
fn clone(&self) -> Protocol
impl Copy for Protocol
impl Debug for Protocol
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Protocol
impl From<i32> for Protocol
fn from(p: c_int) -> Protocol
impl PartialEq for Protocol
fn eq(&self, other: &Protocol) -> bool
impl StructuralPartialEq for Protocol
Auto Trait Implementations
impl Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnsafeUnpin for Protocol
impl UnwindSafe for Protocol
Blanket Implementations
impl<T> Any for Protocol
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Protocol
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Protocol
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Protocol
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Protocol
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Protocol
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Protocol
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Protocol
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Protocol
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>