Enum etherparse::TransportHeader [−][src]
The possible headers on the transport layer
Variants
Udp(UdpHeader)Tcp(TcpHeader)Implementations
impl TransportHeader[src]
pub fn udp(self) -> Option<UdpHeader>[src]
Returns Result::Some containing the udp header if self has the value Udp. Otherwise None is returned.
pub fn mut_udp(&mut self) -> Option<&mut UdpHeader>[src]
Returns Result::Some containing the udp header if self has the value Udp. Otherwise None is returned.
pub fn tcp(self) -> Option<TcpHeader>[src]
Returns Result::Some containing the tcp header if self has the value Tcp. Otherwise None is returned.
pub fn mut_tcp(&mut self) -> Option<&mut TcpHeader>[src]
Returns Result::Some containing a mutable refernce to the tcp header if self has the value Tcp. Otherwise None is returned.
pub fn header_len(&self) -> usize[src]
Returns the size of the transport header (in case of UDP fixed, in case of TCP cotanining the options).dd
pub fn update_checksum_ipv4(
&mut self,
ip_header: &Ipv4Header,
payload: &[u8]
) -> Result<(), ValueError>[src]
&mut self,
ip_header: &Ipv4Header,
payload: &[u8]
) -> Result<(), ValueError>
Calculates the checksum for the transport header & sets it in the header for an ipv4 header.
pub fn update_checksum_ipv6(
&mut self,
ip_header: &Ipv6Header,
payload: &[u8]
) -> Result<(), ValueError>[src]
&mut self,
ip_header: &Ipv6Header,
payload: &[u8]
) -> Result<(), ValueError>
Calculates the checksum for the transport header & sets it in the header for an ipv6 header.
pub fn write<T: Write + Sized>(&self, writer: &mut T) -> Result<(), WriteError>[src]
Write the transport header to the given writer.
Trait Implementations
impl Clone for TransportHeader[src]
fn clone(&self) -> TransportHeader[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for TransportHeader[src]
impl Eq for TransportHeader[src]
impl PartialEq<TransportHeader> for TransportHeader[src]
fn eq(&self, other: &TransportHeader) -> bool[src]
fn ne(&self, other: &TransportHeader) -> bool[src]
impl StructuralEq for TransportHeader[src]
impl StructuralPartialEq for TransportHeader[src]
Auto Trait Implementations
impl RefUnwindSafe for TransportHeader[src]
impl Send for TransportHeader[src]
impl Sync for TransportHeader[src]
impl Unpin for TransportHeader[src]
impl UnwindSafe for TransportHeader[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,