Enum smoltcp::wire::IpRepr [−][src]
#[non_exhaustive]
pub enum IpRepr {
Unspecified {
src_addr: Address,
dst_addr: Address,
protocol: Protocol,
payload_len: usize,
hop_limit: u8,
},
Ipv4(Ipv4Repr),
Ipv6(Ipv6Repr),
}
Expand description
An IP packet representation.
This enum abstracts the various versions of IP packets. It either contains a concrete
high-level representation for some IP protocol version, or an unspecified representation,
which permits the IpAddress::Unspecified
addresses.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Unspecified
Ipv4(Ipv4Repr)
Tuple Fields
0: Ipv4Repr
Ipv6(Ipv6Repr)
Tuple Fields
0: Ipv6Repr
Implementations
Return the payload length.
Set the payload length.
Convert an unspecified representation into a concrete one, or return
Err(Error::Unaddressable)
if not possible.
Panics
This function panics if source and destination addresses belong to different families, or the destination address is unspecified, since this indicates a logic error.
Return the length of a header that will be emitted from this high-level representation.
Panics
This function panics if invoked on an unspecified representation.
Emit this high-level representation into a buffer.
Panics
This function panics if invoked on an unspecified representation.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Repr
impl UnwindSafe for Repr
Blanket Implementations
Mutably borrows from an owned value. Read more