netstack3_core::tcp

Trait TcpBindingsTypes

Source
pub trait TcpBindingsTypes:
    InstantBindingsTypes
    + TimerBindingsTypes
    + 'static {
    type ReceiveBuffer: ReceiveBuffer + Send + Sync;
    type SendBuffer: SendBuffer + Send + Sync;
    type ReturnedBuffers: Debug + Send + Sync;
    type ListenerNotifierOrProvidedBuffers: Debug + IntoBuffers<Self::ReceiveBuffer, Self::SendBuffer> + ListenerNotifier + Send + Sync;

    // Required methods
    fn default_buffer_sizes() -> BufferSizes;
    fn new_passive_open_buffers(
        buffer_sizes: BufferSizes,
    ) -> (Self::ReceiveBuffer, Self::SendBuffer, Self::ReturnedBuffers);
}
Expand description

Bindings types for TCP.

The relationship between buffers is as follows:

The Bindings will receive the ReturnedBuffers so that it can: 1. give the application a handle to read/write data; 2. Observe whatever signal required from the application so that it can inform Core. The peer end of returned handle will be held by the state machine inside the netstack. Specialized receive/send buffers will be derived from ProvidedBuffers from Bindings.

+—————————––+ | +–––––––+ | | | returned | | | | buffers | | | +——+—––+ | | | application| +–––––––+––––––––+ | +–––––––+––––––––+ | | netstack| | +—+——+—––+—+ | | | | provided | | | | | +-+- buffers -+-+ | | | +-+-+–––––––+-+-+ | | v v | |receive buffer send buffer | +—————————––+

Required Associated Types§

Source

type ReceiveBuffer: ReceiveBuffer + Send + Sync

Receive buffer used by TCP.

Source

type SendBuffer: SendBuffer + Send + Sync

Send buffer used by TCP.

Source

type ReturnedBuffers: Debug + Send + Sync

The object that will be returned by the state machine when a passive open connection becomes established. The bindings can use this object to read/write bytes from/into the created buffers.

Source

type ListenerNotifierOrProvidedBuffers: Debug + IntoBuffers<Self::ReceiveBuffer, Self::SendBuffer> + ListenerNotifier + Send + Sync

The extra information provided by the Bindings that implements platform dependent behaviors. It serves as a ListenerNotifier if the socket was used as a listener and it will be used to provide buffers if used to establish connections.

Required Methods§

Source

fn default_buffer_sizes() -> BufferSizes

The buffer sizes to use when creating new sockets.

Source

fn new_passive_open_buffers( buffer_sizes: BufferSizes, ) -> (Self::ReceiveBuffer, Self::SendBuffer, Self::ReturnedBuffers)

Creates new buffers and returns the object that Bindings need to read/write from/into the created buffers.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§