Trait ConnectionReusePolicy
pub trait ConnectionReusePolicy:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn matches(&self, input: &Extensions) -> bool;
// Provided method
fn is_reusable(&self) -> bool { ... }
}Available on crate feature
net only.Expand description
Connection-owned requirements for reusing an established transport.
Publish this through ConnectionReuse after establishment. Matching must be
deterministic, nonblocking and side-effect free for a fixed connector policy.
Pools invoke it outside their storage locks. Retire a pool before changing the
connector’s fixed defaults; these requirements describe its established connections.
Required Methods§
fn matches(&self, input: &Extensions) -> bool
fn matches(&self, input: &Extensions) -> bool
Whether the request’s extensions are compatible with this connection.
Provided Methods§
fn is_reusable(&self) -> bool
fn is_reusable(&self) -> bool
Whether this connection may be retained after its establishing request.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".