Skip to main content

AsyncSource

Trait AsyncSource 

Source
pub trait AsyncSource {
    type Error;

    // Required method
    fn stream<'q, W: Work + 'q, R: Receiver + 'q>(
        &'q mut self,
        receiver: &'q mut R,
        execution: &'q W,
    ) -> impl Future<Output = Result<(), Self::Error>> + 'q;
}
Expand description

Complete payload acquisition that may suspend between bounded chunks. The same sticky receiver and cause precedence govern synchronous sources. No executor, heap allocation, Send bound or blocking adapter is required.

Required Associated Types§

Source

type Error

Original acquisition failure, distinct from callback refusal.

Required Methods§

Source

fn stream<'q, W: Work + 'q, R: Receiver + 'q>( &'q mut self, receiver: &'q mut R, execution: &'q W, ) -> impl Future<Output = Result<(), Self::Error>> + 'q

Feeds every chunk once and returns success only after complete EOF.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§