Struct protoflow_blocks::Drop
source · pub struct Drop<T: Message> {
pub input: InputPort<T>,
}Expand description
A block that simply discards all messages it receives.
§Block Diagram
block-beta
columns 4
Source space:2 Drop
Source-- "input" -->Drop
classDef block height:48px,padding:8px;
classDef hidden visibility:none;
class Drop block
class Source hidden
§Sequence Diagram
sequenceDiagram
autonumber
participant BlockA as Another block
participant Drop.input as Drop.input port
participant Drop as Drop block
BlockA-->>Drop: Connect
loop Drop process
BlockA->>Drop: Message
Drop->>Drop: Drop message
end
BlockA-->>Drop: Disconnect
Drop-->>Drop.input: Close
§Examples
§Using the block in a system
System::build(|s| {
let stdin = s.read_stdin();
let dropper = s.drop();
s.connect(&stdin.output, &dropper.input);
});§Running the block via the CLI
$ protoflow execute Drop
Fields§
§input: InputPort<T>The input message stream.
Implementations§
Trait Implementations§
source§impl<T: Message> Block for Drop<T>
impl<T: Message> Block for Drop<T>
source§fn execute(&mut self, _runtime: &dyn BlockRuntime) -> BlockResult
fn execute(&mut self, _runtime: &dyn BlockRuntime) -> BlockResult
Executes this block’s computation.
source§fn prepare(&mut self, _runtime: &dyn BlockRuntime) -> Result<(), BlockError>
fn prepare(&mut self, _runtime: &dyn BlockRuntime) -> Result<(), BlockError>
Prepares this block for execution. Read more
source§impl<T: Message> BlockDescriptor for Drop<T>
impl<T: Message> BlockDescriptor for Drop<T>
source§fn inputs(&self) -> Vec<PortDescriptor>
fn inputs(&self) -> Vec<PortDescriptor>
A description of this block’s input ports.
source§fn outputs(&self) -> Vec<PortDescriptor>
fn outputs(&self) -> Vec<PortDescriptor>
A description of this block’s output ports.
source§impl<T: Message> Definition for Drop<T>
impl<T: Message> Definition for Drop<T>
fn is_variation(&self) -> bool
source§impl<T: Message> Element for Drop<T>
impl<T: Message> Element for Drop<T>
source§fn short_name(&self) -> Option<&str>
fn short_name(&self) -> Option<&str>
The short name of the element, if any.
source§fn is_library_element(&self) -> bool
fn is_library_element(&self) -> bool
Whether this
Element is contained in the ownership tree of
a library model.source§fn owning_namespace(&self) -> Option<&dyn Namespace>
fn owning_namespace(&self) -> Option<&dyn Namespace>
source§fn owning_relationship(&self) -> Option<&dyn Relationship>
fn owning_relationship(&self) -> Option<&dyn Relationship>
fn qualified_name(&self) -> Option<QualifiedName>
source§impl<T: Message> OccurrenceDefinition for Drop<T>
impl<T: Message> OccurrenceDefinition for Drop<T>
fn is_individual(&self) -> bool
source§impl<T: Message> StdioSystem for Drop<T>
impl<T: Message> StdioSystem for Drop<T>
fn build_system(_config: StdioConfig) -> Result<System, StdioError>
source§impl<T: Message> Type for Drop<T>
impl<T: Message> Type for Drop<T>
fn is_abstract(&self) -> bool
fn is_sufficient(&self) -> bool
fn is_conjugated(&self) -> bool
fn specializes(&self, _supertype: &Self) -> bool
impl<T: Message> BlockDefinition for Drop<T>
impl<T: Message> Class for Drop<T>
impl<T: Message> Classifier for Drop<T>
impl<T: Message> ItemDefinition for Drop<T>
impl<T: Message> PartDefinition for Drop<T>
impl<T: Message> Structure for Drop<T>
Auto Trait Implementations§
impl<T> Freeze for Drop<T>
impl<T> !RefUnwindSafe for Drop<T>
impl<T> Send for Drop<T>
impl<T> Sync for Drop<T>
impl<T> Unpin for Drop<T>where
T: Unpin,
impl<T> !UnwindSafe for Drop<T>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)