FilterHandleExt

Trait FilterHandleExt 

Source
pub trait FilterHandleExt {
    // Required methods
    fn for_filter<TSourceMessage, TTargetStream>(
        filter: impl 'static + Send + Sync + Fn(InputStream<TSourceMessage>) -> TTargetStream,
    ) -> FilterHandle
       where TSourceMessage: 'static + Unpin + SceneMessage,
             TTargetStream: 'static + Send + Stream,
             TTargetStream::Item: 'static + Unpin + SceneMessage;
    fn conversion_filter<TSourceMessage, TTargetMessage>() -> FilterHandle
       where TSourceMessage: 'static + SceneMessage + Into<TTargetMessage>,
             TTargetMessage: 'static + SceneMessage;
    fn source_stream_id_any(&self) -> Result<StreamId, ConnectionError>;
    fn target_stream_id_any(&self) -> Result<StreamId, ConnectionError>;
}

Required Methods§

Source

fn for_filter<TSourceMessage, TTargetStream>( filter: impl 'static + Send + Sync + Fn(InputStream<TSourceMessage>) -> TTargetStream, ) -> FilterHandle
where TSourceMessage: 'static + Unpin + SceneMessage, TTargetStream: 'static + Send + Stream, TTargetStream::Item: 'static + Unpin + SceneMessage,

Returns a filter handle for a filtering function

A filter can be used to convert between an output of one subprogram and the input of another when they are different types. This makes it possible to connect subprograms without needing an intermediate program that performs the conversion.

Source

fn conversion_filter<TSourceMessage, TTargetMessage>() -> FilterHandle
where TSourceMessage: 'static + SceneMessage + Into<TTargetMessage>, TTargetMessage: 'static + SceneMessage,

Creates a filter that converts between two message types that implements From

This will cache the filter handle for specific message types so this won’t allocate additional filters every time it’s called

Source

fn source_stream_id_any(&self) -> Result<StreamId, ConnectionError>

Returns the stream ID for the source of this filter

Source

fn target_stream_id_any(&self) -> Result<StreamId, ConnectionError>

Returns the stream ID for the target of this filter

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§