pub trait TcpBindingsTypes:
InstantBindingsTypes
+ TimerBindingsTypes
+ TxMetadataBindingsTypes
+ MatcherBindingsTypes
+ '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 method
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§
Sourcetype ReceiveBuffer: ReceiveBuffer + Send + Sync
type ReceiveBuffer: ReceiveBuffer + Send + Sync
Receive buffer used by TCP.
Sourcetype SendBuffer: SendBuffer + Send + Sync
type SendBuffer: SendBuffer + Send + Sync
Send buffer used by TCP.
Sourcetype ReturnedBuffers: Debug + Send + Sync
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.
Sourcetype ListenerNotifierOrProvidedBuffers: Debug + IntoBuffers<Self::ReceiveBuffer, Self::SendBuffer> + ListenerNotifier + Send + Sync
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§
Sourcefn new_passive_open_buffers(
buffer_sizes: BufferSizes,
) -> (Self::ReceiveBuffer, Self::SendBuffer, Self::ReturnedBuffers)
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.