Skip to main content

PortsOut

Struct PortsOut 

Source
pub struct PortsOut { /* private fields */ }
Expand description

Declared output ports available to a node execution boundary.

Implementations§

Source§

impl PortsOut

Source

pub fn new(port_ids: impl Into<Vec<PortId>>) -> Self

Create output handles with declared port identifiers and no channels.

Source

pub fn from_handles( port_ids: impl Into<Vec<PortId>>, handles: impl Into<Vec<OutputPortHandle>>, ) -> Self

Create output handles from declared ports and connected channel handles.

Source

pub fn with_metadata_sink( self, metadata_sink: Arc<dyn MetadataSink + Send + Sync>, ) -> Self

Attach a metadata sink for send-side observations.

Source

pub fn with_node_context(self, context: NodeContext) -> Self

Attach node context for send-side queue observations.

Source

pub fn with_output_validator( self, validator: Arc<dyn OutputPacketValidator>, ) -> Self

Attach a validator that runs before output packets enter graph edges.

Source

pub fn port_ids(&self) -> &[PortId]

Declared output port identifiers for this node.

Source

pub const fn is_empty(&self) -> bool

Return whether this node currently has no declared outputs.

Source

pub fn connected_edge_count(&self, port_id: &PortId) -> Option<usize>

Number of connected downstream edges for a declared output port.

Source

pub fn capacity(&self, port_id: &PortId) -> Option<usize>

Capacity of the first connected downstream edge for a declared output port.

Source

pub fn try_send( &self, port_id: &PortId, packet: PortPacket, ) -> Result<(), PortSendError>

Try to send one packet through a declared output port without blocking.

Unconnected declared output ports accept and drop packets. That keeps early scaffold nodes simple while later beads define explicit fan-out and disconnected-edge policy. Connected sends reserve capacity before committing the packet, so cancellation or drop between those phases releases the reserved slots instead of creating partial messages.

§Errors

Returns an error if the port is undeclared, a downstream receiver has disconnected, or a bounded downstream edge is full.

Source

pub async fn send( &self, port_id: &PortId, packet: PortPacket, cancellation: &CancellationToken, ) -> Result<(), PortSendError>

Send one packet through a declared output port, waiting asynchronously for bounded downstream capacity.

§Errors

Returns an error if the port is undeclared, a downstream receiver has disconnected, or cancellation is observed.

Source

pub fn try_reserve( &self, port_id: &PortId, ) -> Result<PortSendPermit<'_>, PortSendError>

Try to reserve output capacity without committing a packet.

Dropping the returned permit releases all reserved downstream slots.

§Errors

Returns an error if the port is undeclared, a downstream receiver has disconnected, or a bounded downstream edge is full.

Source

pub async fn reserve( &self, port_id: &PortId, cancellation: &CancellationToken, ) -> Result<PortSendPermit<'_>, PortSendError>

Reserve output capacity asynchronously without committing a packet.

Dropping the returned permit releases all reserved downstream slots.

§Errors

Returns an error if the port is undeclared, a downstream receiver has disconnected, or cancellation is observed.

Trait Implementations§

Source§

impl Clone for PortsOut

Source§

fn clone(&self) -> PortsOut

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for PortsOut

Source§

fn default() -> PortsOut

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more