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

    // Required methods
    fn new_targets(targets: Array<Self::Elem, Self::Ix>) -> Self::Owned;
    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(targets: Array<Self::Elem, Self::Ix>) -> Self::Owned

Create self object from new target array

source

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

Object Safety§

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(targets: Array<L, I>) -> Self::Owned

Returns an owned representation of the target array

source§

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

Returns a reference to the target array

§

type Owned = ArrayBase<OwnedRepr<L>, I>

§

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::Owned: Labels<Elem = L>, T::View: Labels<Elem = L>,