pub struct Protocol(/* private fields */);Available on crate feature
net only.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