pub trait Policy<P: PeerId>:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn decide(
&self,
request: &PeerRequest<P>,
) -> impl Future<Output = Decision> + Send;
// Provided method
fn filter<F>(self, admit: F) -> Filter<Self, F>
where Self: Sized,
F: Fn(&PeerRequest<P>) -> bool + Send + Sync + 'static { ... }
}Expand description
A rule that decides whether a peer may hold a session, and with which rights.
Implement it with async fn decide.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".