Skip to main content

DynFrameSource

Trait DynFrameSource 

Source
pub trait DynFrameSource: Send + Sync {
    // Required method
    fn next_frame<'a>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, SourceError>> + Send + 'a>>;
}
Expand description

A FrameSource that can sit behind a trait object.

The hand-written spelling of the same method, and the only reason FrameSource does not use async-trait: the box belongs to the callers that need dynamic dispatch, not to the ones that do not.

Required Methods§

Source

fn next_frame<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, SourceError>> + Send + 'a>>

Waits for the peer’s next frame.

§Errors

As FrameSource::next_frame.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T> DynFrameSource for T
where T: FrameSource + Send + Sync,