pub struct WriteStderr {
pub input: InputPort<Bytes>,
}Expand description
A block that writes bytes to standard error (aka stderr).
§Block Diagram
block-beta
columns 4
Source space:2 WriteStderr
Source-- "input" -->WriteStderr
classDef block height:48px,padding:8px;
classDef hidden visibility:none;
class WriteStderr block
class Source hidden
§Sequence Diagram
sequenceDiagram
autonumber
participant BlockA as Another block
participant WriteStderr.input as WriteStderr.input port
participant WriteStderr as WriteStderr block
BlockA-->>WriteStderr: Connect
loop WriteStderr process
BlockA->>WriteStderr: Message (Bytes)
WriteStderr->>WriteStderr: Write bytes to standard error
end
BlockA-->>WriteStderr: Disconnect
WriteStderr-->>WriteStderr.input: Close
§Examples
§Using the block in a system
System::build(|s| {
let stdin = s.read_stdin();
let stderr = s.write_stderr();
s.connect(&stdin.output, &stderr.input);
});§Running the block via the CLI
$ protoflow execute WriteStderr < input.txt 2> output.txtFields§
§input: InputPort<Bytes>The input message stream.
Implementations§
Source§impl WriteStderr
impl WriteStderr
Trait Implementations§
Source§impl Block for WriteStderr
impl Block for WriteStderr
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 BlockDescriptor for WriteStderr
impl BlockDescriptor for WriteStderr
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 Clone for WriteStderr
impl Clone for WriteStderr
Source§fn clone(&self) -> WriteStderr
fn clone(&self) -> WriteStderr
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl MaybeLabeled for WriteStderr
impl MaybeLabeled for WriteStderr
Source§impl MaybeNamed for WriteStderr
impl MaybeNamed for WriteStderr
Source§impl StdioSystem for WriteStderr
impl StdioSystem for WriteStderr
fn build_system(config: StdioConfig) -> Result<System, StdioError>
Auto Trait Implementations§
impl Freeze for WriteStderr
impl !RefUnwindSafe for WriteStderr
impl Send for WriteStderr
impl Sync for WriteStderr
impl Unpin for WriteStderr
impl !UnwindSafe for WriteStderr
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