pub struct Block(/* private fields */);
Expand description
Block
Generic wrapper around a TypedBlock
.
Implementations§
source§impl Block
impl Block
sourcepub fn new<T: Kernel + Send + 'static>(
meta: BlockMeta,
sio: StreamIo,
mio: MessageIo<T>,
kernel: T
) -> Block
pub fn new<T: Kernel + Send + 'static>( meta: BlockMeta, sio: StreamIo, mio: MessageIo<T>, kernel: T ) -> Block
Create Block
sourcepub fn from_typed<T: Kernel + Send + 'static>(b: TypedBlock<T>) -> Block
pub fn from_typed<T: Kernel + Send + 'static>(b: TypedBlock<T>) -> Block
Create block by wrapping a TypedBlock
.
sourcepub fn kernel<T: Kernel + Send + 'static>(&self) -> Option<&T>
pub fn kernel<T: Kernel + Send + 'static>(&self) -> Option<&T>
Try to cast to a given kernel type
sourcepub fn kernel_mut<T: Kernel + Send + 'static>(&mut self) -> Option<&T>
pub fn kernel_mut<T: Kernel + Send + 'static>(&mut self) -> Option<&T>
Try to mutably cast to a given kernel type
sourcepub fn instance_name(&self) -> Option<&str>
pub fn instance_name(&self) -> Option<&str>
Get instance name (see BlockMeta::instance_name
)
sourcepub fn set_instance_name(&mut self, name: impl AsRef<str>)
pub fn set_instance_name(&mut self, name: impl AsRef<str>)
Set instance name (see BlockMeta::set_instance_name
)
sourcepub fn type_name(&self) -> &str
pub fn type_name(&self) -> &str
Get type name (see BlockMeta::type_name
)
sourcepub fn is_blocking(&self) -> bool
pub fn is_blocking(&self) -> bool
Is block blocking (see BlockMeta::is_blocking
)
sourcepub fn set_tag_propagation(
&mut self,
f: Box<dyn FnMut(&mut [StreamInput], &mut [StreamOutput]) + Send + 'static>
)
pub fn set_tag_propagation( &mut self, f: Box<dyn FnMut(&mut [StreamInput], &mut [StreamOutput]) + Send + 'static> )
Set tag propagation function
sourcepub fn stream_inputs(&self) -> &Vec<StreamInput>
pub fn stream_inputs(&self) -> &Vec<StreamInput>
Get stream input ports
sourcepub fn stream_input(&self, id: usize) -> &StreamInput
pub fn stream_input(&self, id: usize) -> &StreamInput
Get stream input port
sourcepub fn stream_input_name_to_id(&self, name: &str) -> Option<usize>
pub fn stream_input_name_to_id(&self, name: &str) -> Option<usize>
Map stream input port name ot id
sourcepub fn stream_outputs(&self) -> &Vec<StreamOutput>
pub fn stream_outputs(&self) -> &Vec<StreamOutput>
Get stream output ports
sourcepub fn stream_output(&self, id: usize) -> &StreamOutput
pub fn stream_output(&self, id: usize) -> &StreamOutput
Get stream output port
sourcepub fn stream_output_name_to_id(&self, name: &str) -> Option<usize>
pub fn stream_output_name_to_id(&self, name: &str) -> Option<usize>
Map stream output port name to id
sourcepub fn message_input_name_to_id(&self, name: &str) -> Option<usize>
pub fn message_input_name_to_id(&self, name: &str) -> Option<usize>
Map message input port name to id
sourcepub fn message_outputs(&self) -> &Vec<MessageOutput>
pub fn message_outputs(&self) -> &Vec<MessageOutput>
Get message output ports
sourcepub fn message_output_name_to_id(&self, name: &str) -> Option<usize>
pub fn message_output_name_to_id(&self, name: &str) -> Option<usize>
Map message output port name to id
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Block
impl Send for Block
impl !Sync for Block
impl Unpin for Block
impl !UnwindSafe for Block
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more