Trait netstack3_core::tcp::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.

Object Safety§

This trait is not object safe.

Implementors§