Skip to main content

TupleOpSignature

Struct TupleOpSignature 

Source
pub struct TupleOpSignature {
    pub name: String,
    pub shape: Vec<TypeId>,
    pub tuple_operand_index: usize,
    pub operand_type_ids: Vec<TypeId>,
    pub op_fn: OpFn,
}
Expand description

A signature for an operator/function whose selected operand is a tuple.

Matches when the operand at tuple_operand_index (0-based, in the same stack order [DynSegment::peek_stack_infos] returns) is a tuple whose element TypeIds equal shape, in order, and every other peeked operand’s flat TypeId equals the corresponding entry in operand_type_ids (the entry at tuple_operand_index in operand_type_ids is never read).

operand_type_ids must have an entry for every non-tuple operand position: a missing entry (out of bounds, including an entirely empty vector when there are non-tuple operands) simply never matches, rather than panicking — it is only safe to omit the whole vector when tuple_operand_index is the only operand position.

shape is flat: an element position that is itself a nested tuple can only be recorded as a flat tuple TypeId, which matches any nested tuple at that position regardless of its inner arity or element types. Two registrations that would only differ by that inner shape are not distinguishable — do not rely on nested-tuple precision at this level.

Fields§

§name: String

Operator/function name this signature is registered under.

§shape: Vec<TypeId>

Expected element TypeIds, in order, for the tuple-shaped operand. See the struct-level note on nested tuples.

§tuple_operand_index: usize

Which peeked operand position must be the tuple.

§operand_type_ids: Vec<TypeId>

Flat TypeIds expected for the non-tuple operands, in stack order (the tuple_operand_index entry is ignored).

§op_fn: OpFn

Function that pushes the operation onto the segment.

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