Struct socket2::Protocol [−][src]
pub struct Protocol(_);
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 the i32 type, however, if a raw
value needs to be provided.
Methods
impl Protocol[src]
impl Protocolpub fn icmpv4() -> Self[src]
pub fn icmpv4() -> SelfProtocol corresponding to ICMPv4
pub fn icmpv6() -> Self[src]
pub fn icmpv6() -> SelfProtocol corresponding to ICMPv6
pub fn tcp() -> Self[src]
pub fn tcp() -> SelfProtocol corresponding to TCP
pub fn udp() -> Self[src]
pub fn udp() -> SelfProtocol corresponding to UDP
Trait Implementations
impl From<i32> for Protocol[src]
impl From<i32> for Protocolimpl From<Protocol> for i32[src]
impl From<Protocol> for i32impl Copy for Protocol[src]
impl Copy for Protocolimpl Clone for Protocol[src]
impl Clone for Protocol