FromTargetArray

Trait FromTargetArray 

Source
pub trait FromTargetArray<'a>: AsTargets {
    type View;

    // Required method
    fn new_targets_view(
        targets: ArrayView<'a, Self::Elem, Self::Ix>,
    ) -> Self::View;
}
Expand description

Helper trait to construct counted labels

This is implemented for objects which can act as targets and created from a target matrix. For targets represented as ndarray matrix this is identity, for counted labels, i.e. TargetsWithLabels, it creates the corresponding wrapper struct.

Required Associated Types§

Required Methods§

Source

fn new_targets_view(targets: ArrayView<'a, Self::Elem, Self::Ix>) -> Self::View

Create self object from new target array

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, L: Clone + 'a, S: Data<Elem = L>, I: TargetDim> FromTargetArray<'a> for ArrayBase<S, I>

Source§

fn new_targets_view(targets: ArrayView<'a, L, I>) -> Self::View

Returns a reference to the target array

Source§

type View = ArrayBase<ViewRepr<&'a L>, I>

Implementors§

Source§

impl<'a, L: Label + 'a, T> FromTargetArray<'a> for CountedTargets<L, T>
where T: FromTargetArray<'a, Elem = L>, T::View: Labels<Elem = L>,