Skip to main content

IpProto

Struct IpProto 

Source
pub struct IpProto(pub u8);
Expand description

$type_name number.

A newtype wrapper around a u8 representing an IpProto number. This type provides named constants for well-known protocols and implements Display to show human-readable protocol names.

Tuple Fields§

§0: u8

Implementations§

Source§

impl IpProto

Source

pub const IPV6_HOPOPT: IpProto

Source

pub const ICMP: IpProto

Source

pub const IGMP: IpProto

Source

pub const GGP: IpProto

Source

pub const IP_ENCAP: IpProto

Source

pub const ST: IpProto

Source

pub const TCP: IpProto

Source

pub const CBT: IpProto

Source

pub const EGP: IpProto

Source

pub const IGP: IpProto

Source

pub const BBN_RCC: IpProto

Source

pub const NVP: IpProto

Source

pub const PUP: IpProto

Source

pub const ARGUS: IpProto

Source

pub const EMCON: IpProto

Source

pub const XNET: IpProto

Source

pub const CHAOS: IpProto

Source

pub const UDP: IpProto

Source

pub const MUX: IpProto

Source

pub const DCN_MEAS: IpProto

Source

pub const HMP: IpProto

Source

pub const PRM: IpProto

Source

pub const XNS_IDP: IpProto

Source

pub const TRUNK1: IpProto

Source

pub const TRUNK2: IpProto

Source

pub const LEAF1: IpProto

Source

pub const LEAF2: IpProto

Source

pub const RDP: IpProto

Source

pub const IRTP: IpProto

Source

pub const ISO_TP4: IpProto

Source

pub const NETBLT: IpProto

Source

pub const MFE_NSP: IpProto

Source

pub const MERIT_INP: IpProto

Source

pub const DCCP: IpProto

Source

pub const _3PC: IpProto

Source

pub const IDPR: IpProto

Source

pub const XTP: IpProto

Source

pub const DDP: IpProto

Source

pub const IDPR_CMTP: IpProto

Source

pub const TP_PP: IpProto

Source

pub const IL: IpProto

Source

pub const IPV6: IpProto

Source

pub const SDRP: IpProto

Source

pub const IPV6_ROUTE: IpProto

Source

pub const IPV6_FRAG: IpProto

Source

pub const IDRP: IpProto

Source

pub const RSVP: IpProto

Source

pub const GRE: IpProto

Source

pub const BNA: IpProto

Source

pub const ESP: IpProto

Source

pub const AH: IpProto

Source

pub const I_NLSP: IpProto

Source

pub const SWIPE: IpProto

Source

pub const NARP: IpProto

Source

pub const MOBILE: IpProto

Source

pub const TLSP: IpProto

Source

pub const SKIP: IpProto

Source

pub const IPV6_ICMP: IpProto

Source

pub const IPV6_NONXT: IpProto

Source

pub const IPV6_OPTS: IpProto

Source

pub const CFTP: IpProto

Source

pub const SAT_EXPAK: IpProto

Source

pub const KRYPTOLAN: IpProto

Source

pub const RVD: IpProto

Source

pub const IPPC: IpProto

Source

pub const SAT_MON: IpProto

Source

pub const VISA: IpProto

Source

pub const IPCU: IpProto

Source

pub const CPNX: IpProto

Source

pub const CPHB: IpProto

Source

pub const WSN: IpProto

Source

pub const PVP: IpProto

Source

pub const BR_SAT_MON: IpProto

Source

pub const SUN_ND: IpProto

Source

pub const WB_MON: IpProto

Source

pub const WB_EXPAK: IpProto

Source

pub const ISO_IP: IpProto

Source

pub const VMTP: IpProto

Source

pub const SECURE_VMTP: IpProto

Source

pub const VINES: IpProto

Source

pub const IPTM: IpProto

Source

pub const NSFNET_IGP: IpProto

Source

pub const DGP: IpProto

Source

pub const TCF: IpProto

Source

pub const EIGRP: IpProto

Source

pub const OSPF: IpProto

Source

pub const SPRITE_RPC: IpProto

Source

pub const LARP: IpProto

Source

pub const MTP: IpProto

Source

pub const AX_25: IpProto

Source

pub const OS: IpProto

Source

pub const MICP: IpProto

Source

pub const SCC_SP: IpProto

Source

pub const ETHERIP: IpProto

Source

pub const ENCAP: IpProto

Source

pub const GMTP: IpProto

Source

pub const IFMP: IpProto

Source

pub const PNNI: IpProto

Source

pub const PIM: IpProto

Source

pub const ARIS: IpProto

Source

pub const SCPS: IpProto

Source

pub const QNX: IpProto

Source

pub const AN: IpProto

Source

pub const IPCOMP: IpProto

Source

pub const SNP: IpProto

Source

pub const COMPAQ_PEER: IpProto

Source

pub const IPX_IN_IP: IpProto

Source

pub const VRRP: IpProto

Source

pub const PGM: IpProto

Source

pub const L2TP: IpProto

Source

pub const DDX: IpProto

Source

pub const IATP: IpProto

Source

pub const STP: IpProto

Source

pub const SRP: IpProto

Source

pub const UTI: IpProto

Source

pub const SMP: IpProto

Source

pub const SM: IpProto

Source

pub const PTP: IpProto

Source

pub const IS_IS: IpProto

Source

pub const FIRE: IpProto

Source

pub const CRTP: IpProto

Source

pub const CRUDP: IpProto

Source

pub const SSCOPMCE: IpProto

Source

pub const IPLT: IpProto

Source

pub const SPS: IpProto

Source

pub const PIPE: IpProto

Source

pub const SCTP: IpProto

Source

pub const FC: IpProto

Source

pub const RSVP_E2E: IpProto

Source

pub const IPV6_MOBILITY: IpProto

Source

pub const UDPLITE: IpProto

Source

pub const MPLS_IN_IP: IpProto

Source

pub const MANET: IpProto

Source

pub const HIP: IpProto

Source

pub const SHIM6: IpProto

Source

pub const WESP: IpProto

Source

pub const ROHC: IpProto

Source

pub const ANY: IpProto

Source

pub fn is_valid(&self) -> bool

Trait Implementations§

Source§

impl Clone for IpProto

Source§

fn clone(&self) -> IpProto

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IpProto

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IpProto

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for IpProto

Available on non-crate feature strata_protocol_names only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for IpProto

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<IpProto> for u8

Source§

fn from(v: IpProto) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for IpProto

Source§

fn from(v: u8) -> Self

Converts to this type from the input type.
Source§

impl FromBytes for IpProto
where u8: FromBytes,

Source§

fn ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout + Immutable,

Interprets the given source as a &Self. Read more
Source§

fn ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout + Immutable,

Interprets the prefix of the given source as a &Self without copying. Read more
Source§

fn ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: Immutable + KnownLayout,

Interprets the suffix of the given bytes as a &Self. Read more
Source§

fn mut_from_bytes( source: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
where Self: IntoBytes + KnownLayout,

Interprets the given source as a &mut Self. Read more
Source§

fn mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
where Self: IntoBytes + KnownLayout,

Interprets the prefix of the given source as a &mut Self without copying. Read more
Source§

fn mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
where Self: IntoBytes + KnownLayout,

Interprets the suffix of the given source as a &mut Self without copying. Read more
Source§

fn read_from_bytes(source: &[u8]) -> Result<Self, SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the given source. Read more
Source§

fn read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the prefix of the given source. Read more
Source§

fn read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the suffix of the given source. Read more
Source§

impl FromZeros for IpProto
where u8: FromZeros,

Source§

fn zero(&mut self)

Overwrites self with zeros. Read more
Source§

fn new_zeroed() -> Self
where Self: Sized,

Creates an instance of Self from zeroed bytes. Read more
Source§

impl Hash for IpProto

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoBytes for IpProto
where u8: IntoBytes, (): PaddingFree<Self, { _ }>,

Source§

fn as_bytes(&self) -> &[u8]
where Self: Immutable,

Gets the bytes of this value. Read more
Source§

fn as_mut_bytes(&mut self) -> &mut [u8]
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
Source§

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
Source§

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
Source§

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
Source§

impl KnownLayout for IpProto
where Self: Sized,

Source§

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
Source§

fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>

Computes the size of an object of type Self with the given pointer metadata. Read more
Source§

impl PartialEq for IpProto

Source§

fn eq(&self, other: &IpProto) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for IpProto

Available on non-crate feature strata_protocol_names only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFromBytes for IpProto

Source§

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
Source§

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
Source§

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
Source§

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
Source§

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
Source§

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
Source§

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
Source§

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
Source§

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
Source§

impl Copy for IpProto

Source§

impl Eq for IpProto

Source§

impl Immutable for IpProto
where u8: Immutable,

Source§

impl StructuralPartialEq for IpProto

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,