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§
impl Copy for Protocol
impl Eq for Protocol
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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)