pub trait StreamAuth: Send + Sync {
// Required method
fn authorize(&self, peer: &PeerId, stream: &StreamId) -> Result<(), String>;
}Expand description
Decides whether peer may subscribe to stream. A closure works.
Required Methods§
Err(reason) refuses the subscription.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".