BufferReader

Trait BufferReader 

Source
pub trait BufferReader: Any {
    // Required methods
    fn as_any_mut(&mut self) -> &mut dyn Any;
    fn init(
        &mut self,
        block_id: BlockId,
        port_id: PortId,
        inbox: Sender<BlockMessage>,
    );
    fn validate(&self) -> Result<(), Error>;
    fn notify_finished<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn finish(&mut self);
    fn finished(&self) -> bool;
    fn block_id(&self) -> BlockId;
    fn port_id(&self) -> PortId;
}
Expand description

The most generic buffer reader

This is the core trait that every buffer reader has to implements. It is what the runtime needs to make things work.

Required Methods§

Source

fn as_any_mut(&mut self) -> &mut dyn Any

for downcasting

Source

fn init( &mut self, block_id: BlockId, port_id: PortId, inbox: Sender<BlockMessage>, )

Initialize buffer

This sets the own block ID, Port ID, and message receiver so that it can be communicated the the other end when making connections.

Source

fn validate(&self) -> Result<(), Error>

Check if connected

Source

fn notify_finished<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

notify upstream that we are done

Source

fn finish(&mut self)

The upstream is done

The Block will usually process the remaining samples and shut down.

Source

fn finished(&self) -> bool

Did the upstream already mark this buffer as done.

Source

fn block_id(&self) -> BlockId

Own Block ID

Source

fn port_id(&self) -> PortId

Own Port ID

Implementors§

Source§

impl<D> BufferReader for futuresdr::runtime::buffer::circular::Reader<D>
where D: CpuSample,

Source§

impl<D> BufferReader for futuresdr::runtime::buffer::slab::Reader<D>
where D: CpuSample,

Source§

impl<T> BufferReader for futuresdr::runtime::buffer::circuit::Reader<T>
where T: CpuSample,

Source§

impl<T: Debug + Send + 'static> BufferReader for futuresdr::runtime::mocker::Reader<T>