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 Protocol
pub fn icmpv4() -> Self
[src]
pub fn icmpv4() -> Self
Protocol corresponding to ICMPv4
pub fn icmpv6() -> Self
[src]
pub fn icmpv6() -> Self
Protocol corresponding to ICMPv6
pub fn tcp() -> Self
[src]
pub fn tcp() -> Self
Protocol corresponding to TCP
pub fn udp() -> Self
[src]
pub fn udp() -> Self
Protocol corresponding to UDP
Trait Implementations
impl From<i32> for Protocol
[src]
impl From<i32> for Protocol
impl From<Protocol> for i32
[src]
impl From<Protocol> for i32
impl Copy for Protocol
[src]
impl Copy for Protocol
impl Clone for Protocol
[src]
impl Clone for Protocol