pub trait Take<Indices: ?Sized> {
type Output;
// Required method
fn take(self, indices: &Indices) -> Self::Output;
}Expand description
Function for taking based on indices (which can have different representations).
Required Associated Types§
Required Methods§
Sourcefn take(self, indices: &Indices) -> Self::Output
fn take(self, indices: &Indices) -> Self::Output
Creates a new object using the elements from the input indexed by indices.
For example, if we have an array [1, 2, 3, 4, 5] and indices [4, 2], the resulting
array would be [5, 3].
The output should have the same length as the indices.
§Panics
This should panic if an index in indices is out-of-bounds with respect to self.
Implementations on Foreign Types§
Source§impl Take<PrimitiveVector> for Vector
impl Take<PrimitiveVector> for Vector
Source§impl<D: NativeDecimalType, I: UnsignedPType> Take<[I]> for &DVector<D>
impl<D: NativeDecimalType, I: UnsignedPType> Take<[I]> for &DVector<D>
Source§impl<D: NativeDecimalType, I: UnsignedPType> Take<PVector<I>> for &DVector<D>
impl<D: NativeDecimalType, I: UnsignedPType> Take<PVector<I>> for &DVector<D>
Source§impl<I: UnsignedPType> Take<[I]> for &DecimalVector
impl<I: UnsignedPType> Take<[I]> for &DecimalVector
type Output = DecimalVector
fn take(self, indices: &[I]) -> DecimalVector
Source§impl<I: UnsignedPType> Take<[I]> for &PrimitiveVector
impl<I: UnsignedPType> Take<[I]> for &PrimitiveVector
type Output = PrimitiveVector
fn take(self, indices: &[I]) -> PrimitiveVector
Source§impl<I: UnsignedPType> Take<[I]> for &BoolVector
impl<I: UnsignedPType> Take<[I]> for &BoolVector
type Output = BoolVector
fn take(self, indices: &[I]) -> BoolVector
Source§impl<I: UnsignedPType> Take<[I]> for &FixedSizeListVector
impl<I: UnsignedPType> Take<[I]> for &FixedSizeListVector
type Output = FixedSizeListVector
fn take(self, indices: &[I]) -> FixedSizeListVector
Source§impl<I: UnsignedPType> Take<[I]> for &ListViewVector
impl<I: UnsignedPType> Take<[I]> for &ListViewVector
type Output = ListViewVector
fn take(self, indices: &[I]) -> ListViewVector
Source§impl<I: UnsignedPType> Take<[I]> for &NullVector
impl<I: UnsignedPType> Take<[I]> for &NullVector
type Output = NullVector
fn take(self, indices: &[I]) -> NullVector
Source§impl<I: UnsignedPType> Take<[I]> for &StructVector
impl<I: UnsignedPType> Take<[I]> for &StructVector
type Output = StructVector
fn take(self, indices: &[I]) -> StructVector
Source§impl<I: UnsignedPType> Take<PVector<I>> for &DecimalVector
impl<I: UnsignedPType> Take<PVector<I>> for &DecimalVector
type Output = DecimalVector
fn take(self, indices: &PVector<I>) -> DecimalVector
Source§impl<I: UnsignedPType> Take<PVector<I>> for &PrimitiveVector
impl<I: UnsignedPType> Take<PVector<I>> for &PrimitiveVector
type Output = PrimitiveVector
fn take(self, indices: &PVector<I>) -> PrimitiveVector
Source§impl<I: UnsignedPType> Take<PVector<I>> for &BoolVector
impl<I: UnsignedPType> Take<PVector<I>> for &BoolVector
type Output = BoolVector
fn take(self, indices: &PVector<I>) -> BoolVector
Source§impl<I: UnsignedPType> Take<PVector<I>> for &FixedSizeListVector
impl<I: UnsignedPType> Take<PVector<I>> for &FixedSizeListVector
type Output = FixedSizeListVector
fn take(self, indices: &PVector<I>) -> FixedSizeListVector
Source§impl<I: UnsignedPType> Take<PVector<I>> for &ListViewVector
impl<I: UnsignedPType> Take<PVector<I>> for &ListViewVector
type Output = ListViewVector
fn take(self, indices: &PVector<I>) -> ListViewVector
Source§impl<I: UnsignedPType> Take<PVector<I>> for &NullVector
impl<I: UnsignedPType> Take<PVector<I>> for &NullVector
type Output = NullVector
fn take(self, indices: &PVector<I>) -> NullVector
Source§impl<I: UnsignedPType> Take<PVector<I>> for &StructVector
impl<I: UnsignedPType> Take<PVector<I>> for &StructVector
type Output = StructVector
fn take(self, indices: &PVector<I>) -> StructVector
Source§impl<T> Take<PrimitiveVector> for &T
impl<T> Take<PrimitiveVector> for &T
Source§impl<T: Copy, I: UnsignedPType> Take<[I]> for &[T]
Specialized implementation for non-nullable indices.
impl<T: Copy, I: UnsignedPType> Take<[I]> for &[T]
Specialized implementation for non-nullable indices.