KernelInterface

Trait KernelInterface 

Source
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§

Source

fn is_blocking() -> bool

If true, the block is run in a spearate thread

Source

fn type_name() -> &'static str

Name of the block

Source

fn stream_inputs(&self) -> Vec<String>

Input Stream Ports

Source

fn stream_outputs(&self) -> Vec<String>

Output Stream Ports.

Source

fn stream_ports_init(&mut self, block_id: BlockId, inbox: Sender<BlockMessage>)

Initialize Stream Ports

This sets required variables but does not connect.

Source

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

This sets required variables but does not connect.

Source

fn stream_input_finish(&mut self, port_id: PortId) -> Result<(), Error>

Mark stream input as finished

Source

fn stream_ports_notify_finished(&mut self) -> impl Future<Output = ()> + Send

Tell adjacent blocks that we are done

Source

fn stream_input(&mut self, name: &str) -> Option<&mut dyn BufferReader>

Get dyn reference to stream input

Source

fn connect_stream_output( &mut self, name: &str, reader: &mut dyn BufferReader, ) -> Result<(), Error>

Connect dyn BufferReader by downcasting it

Source

fn message_inputs() -> &'static [&'static str]

Input Message Handler Names.

Source

fn message_outputs() -> &'static [&'static str]

Output Message Handler Names.

Source

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

Call message handlers of the kernel.

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§

Source§

impl KernelInterface for BlobToUdp

Source§

impl KernelInterface for MessageAnnotator

Source§

impl KernelInterface for MessageBurst

Source§

impl KernelInterface for MessageCopy

Source§

impl KernelInterface for MessagePipe

Source§

impl KernelInterface for MessageSink

Source§

impl KernelInterface for MessageSource

Source§

impl KernelInterface for WebsocketPmtSink

Source§

impl<A, B, I, O> KernelInterface for Filter<A, B, I, O>
where A: 'static, B: 'static, I: CpuBufferReader<Item = A>, O: CpuBufferWriter<Item = B>,

Source§

impl<A, F, O> KernelInterface for SignalSource<A, F, O>
where A: Send + 'static, F: FnMut(FixedPointPhase) -> A + Send + 'static, O: CpuBufferWriter<Item = A>,

Source§

impl<A, const N: usize, const M: usize, IN, OUT> KernelInterface for Selector<A, N, M, IN, OUT>
where A: Send + 'static + Copy, IN: CpuBufferReader<Item = A>, OUT: CpuBufferWriter<Item = A>,

Source§

impl<F> KernelInterface for MessageApply<F>
where F: FnMut(Pmt) -> Result<Option<Pmt>> + Send + 'static,

Source§

impl<F, A, B, C, I, O0, O1> KernelInterface for Split<F, A, B, C, I, O0, O1>
where F: FnMut(&A) -> (B, C) + Send + 'static, A: Send + 'static, B: Send + 'static, C: Send + 'static, I: CpuBufferReader<Item = A>, O0: CpuBufferWriter<Item = B>, O1: CpuBufferWriter<Item = C>,

Source§

impl<F, A, B, C, INA, INB, OUT> KernelInterface for Combine<F, A, B, C, INA, INB, OUT>
where F: FnMut(&A, &B) -> C + Send + 'static, A: Send + 'static, B: Send + 'static, C: Send + 'static, INA: CpuBufferReader<Item = A>, INB: CpuBufferReader<Item = B>, OUT: CpuBufferWriter<Item = C>,

Source§

impl<F, A, B, I, O> KernelInterface for ApplyIntoIter<F, A, B, I, O>
where F: FnMut(&A) -> B + Send + 'static, A: Send + Sync + 'static, B: Send + 'static + IntoIterator, <B as IntoIterator>::Item: Send + Sync + 'static, I: CpuBufferReader<Item = A>, O: CpuBufferWriter<Item = B::Item>,

Source§

impl<F, A, B, IN, OUT> KernelInterface for Apply<F, A, B, IN, OUT>
where F: FnMut(&A) -> B + Send + 'static, A: Send + 'static, B: Send + 'static, IN: CpuBufferReader<Item = A>, OUT: CpuBufferWriter<Item = B>,

Source§

impl<F, A, B, const N: usize, const M: usize, I, O> KernelInterface for ApplyNM<F, A, B, N, M, I, O>
where F: FnMut(&[A], &mut [B]) + Send + 'static, A: Send + 'static, B: Send + 'static, I: CpuBufferReader<Item = A>, O: CpuBufferWriter<Item = B>,

Source§

impl<F, A, I> KernelInterface for Sink<F, A, I>
where F: FnMut(&A) + Send + 'static, A: Send + 'static, I: CpuBufferReader<Item = A>,

Source§

impl<F, A, O> KernelInterface for FiniteSource<F, A, O>
where F: FnMut() -> Option<A> + Send + 'static, A: Send + 'static, O: CpuBufferWriter<Item = A>,

Source§

impl<F, A, O> KernelInterface for Source<F, A, O>
where F: FnMut() -> A + Send + 'static, A: Send + 'static, O: CpuBufferWriter<Item = A>,

Source§

impl<I, O> KernelInterface for Fft<I, O>
where I: CpuBufferReader<Item = Complex32>, O: CpuBufferWriter<Item = Complex32>,

Source§

impl<I, O> KernelInterface for PfbChannelizer<I, O>
where I: CpuBufferReader<Item = Complex32>, O: CpuBufferWriter<Item = Complex32>,

Source§

impl<I, O> KernelInterface for PfbSynthesizer<I, O>
where I: CpuBufferReader<Item = Complex32>, O: CpuBufferWriter<Item = Complex32>,

Source§

impl<I, O> KernelInterface for XlatingFir<I, O>
where I: CpuBufferReader<Item = Complex32>, O: CpuBufferWriter<Item = Complex32>,

Source§

impl<I: CpuBufferReader<Item = Complex32>, O: CpuBufferWriter<Item = Complex32>> KernelInterface for PfbArbResampler<I, O>

Source§

impl<InputType, OutputType, TapType, Core, IN, OUT> KernelInterface for Fir<InputType, OutputType, TapType, Core, IN, OUT>
where InputType: CpuSample, OutputType: CpuSample, TapType: 'static + Send, Core: Filter<InputType, OutputType, TapType> + Send, IN: CpuBufferReader<Item = InputType>, OUT: CpuBufferWriter<Item = OutputType>,

Source§

impl<InputType, OutputType, TapsType, Core, I, O> KernelInterface for Iir<InputType, OutputType, TapsType, Core, I, O>
where InputType: 'static + Send, OutputType: 'static + Send, TapsType: 'static + Send + Taps, Core: 'static + StatefulFilter<InputType, OutputType, TapsType::TapType> + Send, I: CpuBufferReader<Item = InputType>, O: CpuBufferWriter<Item = OutputType>,

Source§

impl<T, I> KernelInterface for ChannelSink<T, I>
where T: Send + Clone + 'static, I: CpuBufferReader<Item = T>,

Source§

impl<T, I> KernelInterface for ConsoleSink<T, I>
where T: Send + 'static + Debug, I: CpuBufferReader<Item = T>,

Source§

impl<T, I> KernelInterface for TagDebug<T, I>
where T: Send + 'static, I: CpuBufferReader<Item = T>,

Source§

impl<T, I> KernelInterface for TcpSink<T, I>
where T: Send + 'static, I: CpuBufferReader<Item = T>,

Source§

impl<T, I, O> KernelInterface for Delay<T, I, O>
where T: Copy + Send + 'static, I: CpuBufferReader<Item = T>, O: CpuBufferWriter<Item = T>,

Source§

impl<T, I, O> KernelInterface for StreamDeinterleaver<T, I, O>
where T: Copy + Send + Sync + 'static, I: CpuBufferReader<Item = T>, O: CpuBufferWriter<Item = T>,

Source§

impl<T, O> KernelInterface for ChannelSource<T, O>
where T: Send + 'static, O: CpuBufferWriter<Item = T>,

Source§

impl<T, O> KernelInterface for TcpSource<T, O>
where T: Send + 'static, O: CpuBufferWriter<Item = T>,

Source§

impl<T, O> KernelInterface for UdpSource<T, O>
where T: Send + 'static, O: CpuBufferWriter<Item = T>,

Source§

impl<T, const N: usize, I: CpuBufferReader<Item = T>, O: CpuBufferWriter<Item = T>> KernelInterface for StreamDuplicator<T, N, I, O>

Source§

impl<T: CpuSample, I: CpuBufferReader<Item = T>> KernelInterface for NullSink<T, I>

Source§

impl<T: CpuSample, I: CpuBufferReader<Item = T>> KernelInterface for WebsocketSink<T, I>

Source§

impl<T: Copy + Send + 'static, I: CpuBufferReader<Item = T>, O: CpuBufferWriter<Item = T>> KernelInterface for Head<T, I, O>

Source§

impl<T: Copy + Send + 'static, I: CpuBufferReader<Item = T>, O: CpuBufferWriter<Item = T>> KernelInterface for Throttle<T, I, O>

Source§

impl<T: Send + 'static, I: CpuBufferReader<Item = T>> KernelInterface for FileSink<T, I>

Source§

impl<T: Send + 'static, O: CpuBufferWriter<Item = T>> KernelInterface for FileSource<T, O>

Source§

impl<T: Send + 'static, O: CpuBufferWriter<Item = T>> KernelInterface for NullSource<T, O>

Source§

impl<T: Send + Sync + 'static, I: CpuBufferReader<Item = T>, O: CpuBufferWriter<Item = T>> KernelInterface for Copy<T, I, O>

Source§

impl<T: Send, I: CpuBufferReader<Item = T>> KernelInterface for VectorSink<T, I>

Source§

impl<T: Send, O: CpuBufferWriter<Item = T>> KernelInterface for VectorSource<T, O>

Source§

impl<const WIDTH: usize, I, O> KernelInterface for MovingAvg<WIDTH, I, O>
where I: CpuBufferReader<Item = f32>, O: CpuBufferWriter<Item = f32>,