Skip to main content

RudaIndex

Trait RudaIndex 

Source
pub trait RudaIndex: RudaType<ExpandType: RudaIndexExpand<Idx = <Self::Idx as RudaType>::ExpandType, Output = <Self::Output as RudaType>::ExpandType>> {
    type Output: RudaType;
    type Idx: RudaType;

    // Provided methods
    fn ruda_idx(&self, _i: Self::Idx) -> &Self::Output { ... }
    fn expand_index(
        scope: &mut Scope,
        array: Self::ExpandType,
        index: <Self::Idx as RudaType>::ExpandType,
    ) -> <Self::Output as RudaType>::ExpandType { ... }
    fn expand_index_unchecked(
        scope: &mut Scope,
        array: Self::ExpandType,
        index: <Self::Idx as RudaType>::ExpandType,
    ) -> <Self::Output as RudaType>::ExpandType { ... }
}
Expand description

Fake indexation so we can rewrite indexes into scalars as calls to this fake function in the non-expanded function

Required Associated Types§

Provided Methods§

Source

fn ruda_idx(&self, _i: Self::Idx) -> &Self::Output

Source

fn expand_index( scope: &mut Scope, array: Self::ExpandType, index: <Self::Idx as RudaType>::ExpandType, ) -> <Self::Output as RudaType>::ExpandType

Source

fn expand_index_unchecked( scope: &mut Scope, array: Self::ExpandType, index: <Self::Idx as RudaType>::ExpandType, ) -> <Self::Output as RudaType>::ExpandType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§