Skip to main content

JoinTrigger

Enum JoinTrigger 

Source
pub enum JoinTrigger {
#[non_exhaustive]
Input { index: usize, value: Box<dyn Any + Send>, metadata: WriteMetadata, }, }
Expand description

Identifies which input produced a value in a multi-input join transform.

Passed to the event loop inside the closure registered with JoinBuilder::on_triggers. Use JoinTrigger::index to branch on the source input and JoinTrigger::as_input to downcast the value to the concrete type.

§Why this carries Box<dyn Any>

This is the one deliberate exception to the data-plane de-erasure A join fans N differently-typed inputs into a single trigger channel, and the user’s on_triggers closure branches on them via JoinTrigger::as_input — the erasure is the public API here, not an implementation accident. Removing it would mean N channels or a generated input enum, i.e. a different feature. The cost (one box + downcast per join input value) is confined to this module and applies only to explicit user-built joins, never to the connector spine.

Variants§

§

#[non_exhaustive]
Input

A value written to input index. metadata is the write metadata of that input value; match with .., more fields may follow.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§index: usize
§value: Box<dyn Any + Send>
§metadata: WriteMetadata

Implementations§

Source§

impl JoinTrigger

Source

pub fn as_input<T: 'static>(&self) -> Option<&T>

Source

pub fn index(&self) -> usize

Source

pub fn metadata(&self) -> &WriteMetadata

The write metadata of the input value. The join’s output is a new write with its own; pairing inputs on write time is an application choice (design 058 §1).

Source

pub fn stamp(&self) -> Stamp

When the input value was written, on the instance clock.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.