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§
Sourcefn next_frame<'a>(
&'a self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SourceError>> + Send + 'a>>
fn next_frame<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, SourceError>> + Send + 'a>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".