Skip to main content

StreamAuth

Trait StreamAuth 

Source
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§

Source

fn authorize(&self, peer: &PeerId, stream: &StreamId) -> Result<(), String>

Err(reason) refuses the subscription.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§