Skip to main content

JoinTrigger

Enum JoinTrigger 

Source
pub enum JoinTrigger {
    Input {
        index: usize,
        value: Box<dyn Any + Send>,
    },
}
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§

§

Input

Fields

§index: usize
§value: Box<dyn Any + Send>

Implementations§

Source§

impl JoinTrigger

Source

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

Source

pub fn index(&self) -> usize

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.