TcpOptionsBuilder

Struct TcpOptionsBuilder 

Source
pub struct TcpOptionsBuilder<'a> {
    pub mss: Option<u16>,
    pub window_scale: Option<u8>,
    pub sack_permitted: bool,
    pub sack_blocks: Option<&'a [TcpSackBlock]>,
    pub timestamp: Option<TimestampOption>,
}
Expand description

A type capable of serializing TCP Options.

Fields§

§mss: Option<u16>

The MSS Option to serialize, if any.

§window_scale: Option<u8>

The Window Scale Option to serialize, if any.

§sack_permitted: bool

Whether or not to serialize a SACK Permitted option.

§sack_blocks: Option<&'a [TcpSackBlock]>

The SACK Option to serialize, if any.

§timestamp: Option<TimestampOption>

The Timestamp Option to serialize, if any.

Trait Implementations§

Source§

impl<'a> Debug for TcpOptionsBuilder<'a>

Source§

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

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

impl<'a> Default for TcpOptionsBuilder<'a>

Source§

fn default() -> TcpOptionsBuilder<'a>

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

impl<'a> InnerPacketBuilder for TcpOptionsBuilder<'a>

Source§

fn bytes_len(&self) -> usize

The number of bytes consumed by this packet.
Source§

fn serialize(&self, buffer: &mut [u8])

Serializes this packet into an existing buffer. Read more
Source§

fn into_serializer(self) -> InnerSerializer<Self, EmptyBuf>
where Self: Sized,

Converts this InnerPacketBuilder into a Serializer. Read more
Source§

fn into_serializer_with<B>(self, buffer: B) -> InnerSerializer<Self, B>
where B: ShrinkBuffer, Self: Sized,

Converts this InnerPacketBuilder into a Serializer with a buffer that can be used for serialization. Read more
Source§

impl<'a> TcpOptions for &TcpOptionsBuilder<'a>

Source§

fn mss(&self) -> Option<u16>

Access the MSS option, if present.
Source§

fn window_scale(&self) -> Option<u8>

Access the Window Scale option, if present.
Source§

fn sack_permitted(&self) -> bool

Access the SACK Permitted option, if present.
Source§

fn sack_blocks(&self) -> Option<&[TcpSackBlock]>

Access the SACK option, if present.
Source§

fn timestamp(&self) -> Option<&TimestampOption>

Access the timestamp option, if present.

Auto Trait Implementations§

§

impl<'a> Freeze for TcpOptionsBuilder<'a>

§

impl<'a> RefUnwindSafe for TcpOptionsBuilder<'a>

§

impl<'a> Send for TcpOptionsBuilder<'a>

§

impl<'a> Sync for TcpOptionsBuilder<'a>

§

impl<'a> Unpin for TcpOptionsBuilder<'a>

§

impl<'a> UnwindSafe for TcpOptionsBuilder<'a>

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.