Skip to main content

StaticSource

Trait StaticSource 

Source
pub trait StaticSource {
    // Required method
    async fn next(&mut self) -> Result<Option<Frame>, G2gError>;
}
Expand description

A heap-free source: yields frames until the stream ends (Ok(None) at EOS).

The #[allow(async_fn_in_trait)] is intentional: this model targets a single executor (an Embassy task on an MCU, block_on on a host), so the auto-trait (Send) leakage the lint warns about is a non-issue, and avoiding it (a boxed or -> impl Future + Send return) would reintroduce the allocation this model exists to remove.

Required Methods§

Source

async fn next(&mut self) -> Result<Option<Frame>, G2gError>

Produce the next frame, or Ok(None) at end of stream.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<S: StaticSource> StaticSource for &mut S

Source§

async fn next(&mut self) -> Result<Option<Frame>, G2gError>

Implementors§

Source§

impl<I: FnMut(), const N: usize, const BYTES: usize> StaticSource for SpscCaptureSrc<'_, I, N, BYTES>

Available on non-loom only.
Source§

impl<S: StaticSource, T: StaticTransform> StaticSource for SourceChain<S, T>