pub struct Drop<T: Message = Any> {
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 DropFields§
§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§fn parameters(&self) -> Vec<ParameterDescriptor>
fn parameters(&self) -> Vec<ParameterDescriptor>
A description of this block’s parameters.
Source§fn ports(&self) -> Vec<PortDescriptor>
fn ports(&self) -> Vec<PortDescriptor>
A description of this block’s I/O ports.
Source§impl<T: Message> MaybeLabeled for Drop<T>
impl<T: Message> MaybeLabeled for Drop<T>
Source§impl<T: Message> MaybeNamed for Drop<T>
impl<T: Message> MaybeNamed for Drop<T>
Source§impl<T: Message> StdioSystem for Drop<T>
impl<T: Message> StdioSystem for Drop<T>
fn build_system(config: StdioConfig) -> Result<System, StdioError>
Auto Trait Implementations§
impl<T> Freeze for Drop<T>
impl<T = Any> !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 = Any> !UnwindSafe for Drop<T>
Blanket Implementations§
Source§impl<T> AsBlockDescriptor for Twhere
T: BlockDescriptor,
impl<T> AsBlockDescriptor for Twhere
T: BlockDescriptor,
fn as_block_descriptor(&self) -> &dyn BlockDescriptor
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