pub trait Source:
Prepare
+ Source
+ Source
+ Sized {
type Control: Copy + AsRef<[u8]>;
type Combined;
// Required methods
fn control(source: Address) -> Self::Control;
fn compose(
source: Self::Control,
gso: Option<<Self as Source>::Mode>,
) -> Self::Combined;
fn release(
control: Self::Combined,
) -> (Self::Control, Option<<Self as Source>::Mode>);
fn bytes(control: &mut Self::Combined) -> &[u8] ⓘ;
// Provided method
fn source(
bind: SocketAddr,
peer: SocketAddr,
) -> Result<(Address, Self::Control), Error> { ... }
}Expand description
Selects the native ancillary encoding for a fixed datagram source.
Required Associated Types§
Required Methods§
fn control(source: Address) -> Self::Control
fn compose( source: Self::Control, gso: Option<<Self as Source>::Mode>, ) -> Self::Combined
fn release( control: Self::Combined, ) -> (Self::Control, Option<<Self as Source>::Mode>)
fn bytes(control: &mut Self::Combined) -> &[u8] ⓘ
Provided Methods§
Sourcefn source(
bind: SocketAddr,
peer: SocketAddr,
) -> Result<(Address, Self::Control), Error>
fn source( bind: SocketAddr, peer: SocketAddr, ) -> Result<(Address, Self::Control), Error>
Preserves an explicit source; resolves wildcard binds once on a separate socket.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".