Skip to main content

Output

Struct Output 

Source
pub struct Output<T> { /* private fields */ }
Expand description

A typed publishing handle for one of the node’s outputs.

Implementations§

Source§

impl<T> Output<T>

Source

pub fn send_arrow<A>( &mut self, value: &A, metadata: Metadata, ) -> ArrowSendResult<()>
where A: ?Sized, for<'a> RecordBatch: TryFrom<&'a A, Error = InteropError>,

Available on crate feature arrow-interop only.

Publishes an arrow-rs value, bypassing the type.

As RawOutput::send_arrow; the typed skin offers it for the same reason it offers Output::send_batch — a typed handle should not be a reason to go and fetch the raw one.

§Errors

As RawOutput::send_arrow.

Source§

impl<T> Output<T>

Source

pub const fn new(raw: RawOutput) -> Self

Wraps an untyped handle.

Source

pub const fn id(&self) -> &DataId

The output’s id.

Source

pub fn plane(&self) -> RoutePlane

The plane this output publishes on right now (§6.3).

Source

pub fn consumers(&self) -> &[PortRef]

The consumers the daemon reported at upgrade time.

Source

pub fn metadata(&self) -> Metadata

A fresh metadata block stamped with this node’s clock (§4.3).

Source

pub const fn raw(&self) -> &RawOutput

The untyped handle underneath, for a send this type cannot express.

Source

pub const fn raw_mut(&mut self) -> &mut RawOutput

The untyped handle underneath, mutably.

Source

pub fn into_raw(self) -> RawOutput

Unwraps the typed skin.

Source

pub fn send_bytes( &mut self, bytes: impl AsRef<[u8]>, metadata: Metadata, ) -> Result<()>

Publishes raw payload bytes, bypassing the type.

§Errors

As RawOutput::send_bytes.

Source

pub fn send_batch( &mut self, batch: &RecordBatch, metadata: Metadata, ) -> Result<()>

Publishes a record batch, bypassing the type.

§Errors

As RawOutput::send_batch.

Source

pub fn send_array(&mut self, array: ArrayRef, metadata: Metadata) -> Result<()>

Publishes a single column as a whole payload, bypassing the type.

§Errors

As RawOutput::send_array.

Source

pub fn allocate(&mut self, len: usize) -> Result<OutputSample<'_>>

Reserves len bytes to write into (§9.1).

§Errors

As RawOutput::allocate.

Source

pub fn close(&mut self) -> Result<()>

Tells the daemon this output will produce nothing further.

§Errors

As RawOutput::close.

Source§

impl<T: AstrsMessage> Output<T>

Source

pub const fn type_urn(&self) -> &'static str

The type URN this handle publishes.

Source

pub fn send(&mut self, value: impl Into<T>, metadata: Metadata) -> Result<()>

Publishes one value.

§Errors

crate::NodeError::Data when the value cannot be encoded, plus whatever RawOutput::send_batch reports.

Source

pub fn publish(&mut self, value: impl Into<T>) -> Result<()>

Publishes one value with a freshly stamped metadata block.

The shortest form, for a node with nothing to correlate.

§Errors

As Output::send.

Source

pub fn send_following( &mut self, value: impl Into<T>, cause: &Metadata, ) -> Result<()>

Publishes one value, following cause’s correlation and timing metadata (§9.4).

This is the blueprint §9.1 shape: detections.send(run_model(&img)?, meta.follow())? — the response of a service, the next chunk of a stream, and the derived output of a pipeline stage all keep the keys that make them traceable.

§Errors

As Output::send.

Trait Implementations§

Source§

impl<T: Debug> Debug for Output<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Output<T>
where PhantomData<fn(T)>: Freeze,

§

impl<T> RefUnwindSafe for Output<T>

§

impl<T> Send for Output<T>
where PhantomData<fn(T)>: Send,

§

impl<T> Sync for Output<T>
where PhantomData<fn(T)>: Sync,

§

impl<T> Unpin for Output<T>
where PhantomData<fn(T)>: Unpin,

§

impl<T> UnsafeUnpin for Output<T>

§

impl<T> UnwindSafe for Output<T>

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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: 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> MaybeDebug for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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