pub struct OutputSender { /* private fields */ }Expand description
A handle given to a node to send its output packets.
Implementations§
Source§impl OutputSender
impl OutputSender
Sourcepub fn new(node_name: String, routing: OutputRouting) -> Self
pub fn new(node_name: String, routing: OutputRouting) -> Self
Creates a new OutputSender.
Note: The node_name String is converted to Arc
Sourcepub async fn send(
&mut self,
pin_name: &str,
packet: Packet,
) -> Result<(), OutputSendError>
pub async fn send( &mut self, pin_name: &str, packet: Packet, ) -> Result<(), OutputSendError>
Sends a packet from a specific output pin of this node.
Returns Ok(()) if sent successfully.
Nodes should stop processing when this returns an error, as it indicates either a programming mistake (unknown pin) or that the pipeline is shutting down.
§Errors
Returns OutputSendError::PinNotFound if the pin doesn’t exist, or
OutputSendError::ChannelClosed if the receiving channel is closed.
Trait Implementations§
Source§impl Clone for OutputSender
impl Clone for OutputSender
Source§fn clone(&self) -> OutputSender
fn clone(&self) -> OutputSender
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for OutputSender
impl RefUnwindSafe for OutputSender
impl Send for OutputSender
impl Sync for OutputSender
impl Unpin for OutputSender
impl UnwindSafe for OutputSender
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