pub struct TcpSegmentBuilder<'a, 'b> { /* private fields */ }Expand description
Builds a TCP header in caller-owned storage.
Implementations§
Source§impl<'a, 'b> TcpSegmentBuilder<'a, 'b>
impl<'a, 'b> TcpSegmentBuilder<'a, 'b>
Sourcepub fn new(buffer: &'a mut [u8], payload_length: usize) -> Self
pub fn new(buffer: &'a mut [u8], payload_length: usize) -> Self
Starts a builder for payload_length bytes, which are left untouched.
Sourcepub fn source_port(self, value: u16) -> Self
pub fn source_port(self, value: u16) -> Self
Supplies the source port.
Sourcepub fn destination_port(self, value: u16) -> Self
pub fn destination_port(self, value: u16) -> Self
Supplies the destination port.
Sourcepub fn sequence_number(self, value: u32) -> Self
pub fn sequence_number(self, value: u32) -> Self
Supplies the sequence number.
Sourcepub fn acknowledgment_number(self, value: u32) -> Self
pub fn acknowledgment_number(self, value: u32) -> Self
Supplies the acknowledgment number.
Sourcepub fn window_size(self, value: u16) -> Self
pub fn window_size(self, value: u16) -> Self
Supplies the window size.
Sourcepub fn urgent_pointer(self, value: u16) -> Self
pub fn urgent_pointer(self, value: u16) -> Self
Supplies the urgent pointer.
Sourcepub fn build(self) -> Result<TcpSegmentMut<'a>, TcpSegmentBuildError>
pub fn build(self) -> Result<TcpSegmentMut<'a>, TcpSegmentBuildError>
Validates inputs and writes only the TCP header and options.
Auto Trait Implementations§
impl<'a, 'b> !UnwindSafe for TcpSegmentBuilder<'a, 'b>
impl<'a, 'b> Freeze for TcpSegmentBuilder<'a, 'b>
impl<'a, 'b> RefUnwindSafe for TcpSegmentBuilder<'a, 'b>
impl<'a, 'b> Send for TcpSegmentBuilder<'a, 'b>
impl<'a, 'b> Sync for TcpSegmentBuilder<'a, 'b>
impl<'a, 'b> Unpin for TcpSegmentBuilder<'a, 'b>
impl<'a, 'b> UnsafeUnpin for TcpSegmentBuilder<'a, 'b>
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