Struct smoltcp::wire::TcpRepr

source ·
pub struct TcpRepr<'a> {
    pub src_port: u16,
    pub dst_port: u16,
    pub control: Control,
    pub seq_number: SeqNumber,
    pub ack_number: Option<SeqNumber>,
    pub window_len: u16,
    pub window_scale: Option<u8>,
    pub max_seg_size: Option<u16>,
    pub payload: &'a [u8],
}
Expand description

A high-level representation of a Transmission Control Protocol packet.

Fields§

§src_port: u16§dst_port: u16§control: Control§seq_number: SeqNumber§ack_number: Option<SeqNumber>§window_len: u16§window_scale: Option<u8>§max_seg_size: Option<u16>§payload: &'a [u8]

Implementations§

Parse a Transmission Control Protocol packet and return a high-level representation.

Return the length of a header that will be emitted from this high-level representation.

This should be used for buffer space calculations. The TCP header length is a multiple of 4.

Return the length of the header for the TCP protocol.

Per RFC 6691, this should be used for MSS calculations. It may be smaller than the buffer space required to accomodate this packet’s data.

Return the length of a packet that will be emitted from this high-level representation.

Emit a high-level representation into a Transmission Control Protocol packet.

Return the length of the segment, in terms of sequence space.

Return whether the segment has no flags set (except PSH) and no data.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.