pub trait KernelInterface {
Show 13 methods
// Required methods
fn is_blocking() -> bool;
fn type_name() -> &'static str;
fn stream_inputs(&self) -> Vec<String>;
fn stream_outputs(&self) -> Vec<String>;
fn stream_ports_init(
&mut self,
block_id: BlockId,
inbox: Sender<BlockMessage>,
);
fn stream_ports_validate(&self) -> Result<(), Error>;
fn stream_input_finish(&mut self, port_id: PortId) -> Result<(), Error>;
fn stream_ports_notify_finished(
&mut self,
) -> impl Future<Output = ()> + Send;
fn stream_input(&mut self, name: &str) -> Option<&mut dyn BufferReader>;
fn connect_stream_output(
&mut self,
name: &str,
reader: &mut dyn BufferReader,
) -> Result<(), Error>;
fn message_inputs() -> &'static [&'static str];
fn message_outputs() -> &'static [&'static str];
fn call_handler(
&mut self,
_io: &mut WorkIo,
_mio: &mut MessageOutputs,
_meta: &mut BlockMeta,
id: PortId,
_p: Pmt,
) -> impl Future<Output = Result<Pmt, Error>> + Send;
}Expand description
Interface to the Kernel, implemented by the block macro.
Required Methods§
Sourcefn is_blocking() -> bool
fn is_blocking() -> bool
If true, the block is run in a spearate thread
Sourcefn stream_inputs(&self) -> Vec<String>
fn stream_inputs(&self) -> Vec<String>
Input Stream Ports
Sourcefn stream_outputs(&self) -> Vec<String>
fn stream_outputs(&self) -> Vec<String>
Output Stream Ports.
Sourcefn stream_ports_init(&mut self, block_id: BlockId, inbox: Sender<BlockMessage>)
fn stream_ports_init(&mut self, block_id: BlockId, inbox: Sender<BlockMessage>)
Initialize Stream Ports
This sets required variables but does not connect.
Sourcefn stream_ports_validate(&self) -> Result<(), Error>
fn stream_ports_validate(&self) -> Result<(), Error>
This sets required variables but does not connect.
Sourcefn stream_input_finish(&mut self, port_id: PortId) -> Result<(), Error>
fn stream_input_finish(&mut self, port_id: PortId) -> Result<(), Error>
Mark stream input as finished
Sourcefn stream_ports_notify_finished(&mut self) -> impl Future<Output = ()> + Send
fn stream_ports_notify_finished(&mut self) -> impl Future<Output = ()> + Send
Tell adjacent blocks that we are done
Sourcefn stream_input(&mut self, name: &str) -> Option<&mut dyn BufferReader>
fn stream_input(&mut self, name: &str) -> Option<&mut dyn BufferReader>
Get dyn reference to stream input
Sourcefn connect_stream_output(
&mut self,
name: &str,
reader: &mut dyn BufferReader,
) -> Result<(), Error>
fn connect_stream_output( &mut self, name: &str, reader: &mut dyn BufferReader, ) -> Result<(), Error>
Connect dyn BufferReader by downcasting it
Sourcefn message_inputs() -> &'static [&'static str]
fn message_inputs() -> &'static [&'static str]
Input Message Handler Names.
Sourcefn message_outputs() -> &'static [&'static str]
fn message_outputs() -> &'static [&'static str]
Output Message Handler Names.
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.