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§
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
for downcasting
Sourcefn init(
&mut self,
block_id: BlockId,
port_id: PortId,
inbox: Sender<BlockMessage>,
)
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.
Sourcefn notify_finished<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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