pub struct Protocol(/* private fields */);
Expand description
IPPROTO_*
and other constants for use with socket
, socket_with
,
and socketpair
when a nondefault value is desired. See the ipproto
,
sysproto
, and netlink
modules for possible values.
For the default values, such as IPPROTO_IP
or NETLINK_ROUTE
, pass
None
as the protocol
argument in these functions.
Implementations§
source§impl Protocol
impl Protocol
sourcepub const fn from_raw(raw: RawProtocol) -> Self
pub const fn from_raw(raw: RawProtocol) -> Self
Constructs a Protocol
from a raw integer.
sourcepub const fn as_raw(self) -> RawProtocol
pub const fn as_raw(self) -> RawProtocol
Returns the raw integer for this Protocol
.
Trait Implementations§
source§impl PartialEq for Protocol
impl PartialEq for Protocol
impl Copy for Protocol
impl Eq for Protocol
impl StructuralEq for Protocol
impl StructuralPartialEq for Protocol
Auto Trait Implementations§
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more