Struct packet_formats::tcp::TcpSegmentBuilderWithOptions
source · pub struct TcpSegmentBuilderWithOptions<A: IpAddress, O> { /* private fields */ }
Expand description
A builder for TCP segments with options
Implementations§
source§impl<'a, A, I> TcpSegmentBuilderWithOptions<A, OptionSequenceBuilder<TcpOption<'a>, I>>
impl<'a, A, I> TcpSegmentBuilderWithOptions<A, OptionSequenceBuilder<TcpOption<'a>, I>>
sourcepub fn new<T: IntoIterator<IntoIter = I>>(
prefix_builder: TcpSegmentBuilder<A>,
options: T
) -> Result<TcpSegmentBuilderWithOptions<A, OptionSequenceBuilder<TcpOption<'a>, I>>, TcpOptionsTooLongError>
pub fn new<T: IntoIterator<IntoIter = I>>( prefix_builder: TcpSegmentBuilder<A>, options: T ) -> Result<TcpSegmentBuilderWithOptions<A, OptionSequenceBuilder<TcpOption<'a>, I>>, TcpOptionsTooLongError>
Creates a TcpSegmentBuilderWithOptions
.
Returns Err
if the segment header would exceed the maximum length of
MAX_HDR_LEN
. This happens if the options
, when serialized, would
exceed MAX_OPTIONS_LEN
.
source§impl<A: IpAddress, O> TcpSegmentBuilderWithOptions<A, O>
impl<A: IpAddress, O> TcpSegmentBuilderWithOptions<A, O>
sourcepub fn src_port(&self) -> Option<NonZeroU16>
pub fn src_port(&self) -> Option<NonZeroU16>
Returns the source port for the builder.
sourcepub fn dst_port(&self) -> Option<NonZeroU16>
pub fn dst_port(&self) -> Option<NonZeroU16>
Returns the destination port for the builder.
Trait Implementations§
source§impl<A: IpAddress, O: InnerPacketBuilder> PacketBuilder for TcpSegmentBuilderWithOptions<A, O>
impl<A: IpAddress, O: InnerPacketBuilder> PacketBuilder for TcpSegmentBuilderWithOptions<A, O>
Auto Trait Implementations§
impl<A, O> Freeze for TcpSegmentBuilderWithOptions<A, O>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + Freeze,
O: Freeze,
impl<A, O> RefUnwindSafe for TcpSegmentBuilderWithOptions<A, O>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + RefUnwindSafe,
O: RefUnwindSafe,
impl<A, O> Send for TcpSegmentBuilderWithOptions<A, O>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static,
O: Send,
impl<A, O> Sync for TcpSegmentBuilderWithOptions<A, O>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static,
O: Sync,
impl<A, O> Unpin for TcpSegmentBuilderWithOptions<A, O>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + Unpin,
O: Unpin,
impl<A, O> UnwindSafe for TcpSegmentBuilderWithOptions<A, O>where
A: Sealed + GenericOverIp<Ipv6, Type = Ipv6Addr, Type = Ipv4Addr, Type = A> + GenericOverIp<Ipv4> + GenericOverIp<<A as IpAddress>::Version> + ScopeableAddress + LinkLocalAddress + Send + Sync + Default + Debug + Display + Copy + Clone + Hash + Ord + PartialOrd + PartialEq + Eq + 'static + UnwindSafe,
O: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more