Struct Type
pub struct Type(/* private field */);
Specification of communication semantics on a socket.
This is a newtype wrapper around an integer which provides a nicer API in
addition to an injection point for documentation. Convenience constants such
as Type::STREAM, Type::DGRAM, etc, are provided to avoid reaching
into libc for various constants.
This type is freely interconvertible with C's int type, however, if a raw
value needs to be provided.
Implementations
impl Type
const STREAM: Type = _;Type corresponding to
SOCK_STREAM.Used for protocols such as TCP.
const DGRAM: Type = _;Type corresponding to
SOCK_DGRAM.Used for protocols such as UDP.
const DCCP: Type = _;Type corresponding to
SOCK_DCCP.Used for the DCCP protocol.
const SEQPACKET: Type = _;Type corresponding to
SOCK_SEQPACKET.const RAW: Type = _;Type corresponding to
SOCK_RAW.
impl Type
const fn nonblocking(self) -> TypeSet
SOCK_NONBLOCKon theType.const fn cloexec(self) -> TypeSet
SOCK_CLOEXECon theType.
Trait Implementations
impl Clone for Type
fn clone(&self) -> Self
impl Copy for Type
impl Debug for Type
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Type
impl From<i32> for Type
fn from(t: c_int) -> Type
impl PartialEq for Type
fn eq(&self, other: &Self) -> bool