Trait DatagramGates
pub trait DatagramGates:
Send
+ Sync
+ 'static {
// Required method
fn admit(&self, direction: GateDirection, len: usize) -> bool;
}Available on crate feature
net only.Expand description
Admits or drops the datagrams of a multiplexed connection, such as QUIC DATAGRAM frames.
Datagrams are unreliable, so a gate never makes one wait: a refused datagram is dropped, and the connection counts it. A gate is never called while the transport holds a lock, and only for a datagram the transport would otherwise deliver or accept for sending.
Required Methods§
fn admit(&self, direction: GateDirection, len: usize) -> bool
fn admit(&self, direction: GateDirection, len: usize) -> bool
Whether a datagram of len bytes may move in direction: received from the peer
(GateDirection::Read) or sent to it (GateDirection::Write).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".