Skip to main content

Source

Trait Source 

Source
pub trait Source<T: PipelineIO>: Data {
    // Required methods
    fn on_next<'life0, 'async_trait>(
        &'life0 self,
        data: T,
        __arg2: Token,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_edge(&self, edge: Edge<T>, _: Token) -> Result<(), PipelineError>;

    // Provided methods
    fn link<S: Sink<T> + 'static>(
        &self,
        sink: Arc<S>,
    ) -> Result<Arc<S>, PipelineError> { ... }
    fn link_terminal<S: Sink<T> + 'static>(
        &self,
        sink: Arc<S>,
    ) -> Result<Arc<S>, PipelineError> { ... }
}
Expand description

A Source trait defines how data is emitted from a source to a downstream sink.

Required Methods§

Source

fn on_next<'life0, 'async_trait>( &'life0 self, data: T, __arg2: Token, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn set_edge(&self, edge: Edge<T>, _: Token) -> Result<(), PipelineError>

Provided Methods§

Close a pipeline response path without creating an ownership cycle.

The returned sink is the pipeline’s ownership root and must be retained by the caller.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<In: PipelineIO, Out: PipelineIO> Source<In> for SegmentSource<In, Out>

Source§

impl<In: PipelineIO, Out: PipelineIO> Source<In> for ServiceFrontend<In, Out>

Source§

impl<In: PipelineIO, Out: PipelineIO> Source<Out> for PipelineNode<In, Out>

Source§

impl<Req: PipelineIO, Resp: PipelineIO> Source<Resp> for SegmentSink<Req, Resp>

Source§

impl<Req: PipelineIO, Resp: PipelineIO> Source<Resp> for ServiceBackend<Req, Resp>