Skip to main content

TakeRef

Trait TakeRef 

Source
pub trait TakeRef {
    type Item;

    // Required method
    fn take_ref(&self, n: usize) -> &[Self::Item];
}
Expand description

Returns a borrowed start of a slice, defined by a given size of number of items to take Provides borrowed views over the beginning of a slice.

Required Associated Types§

Required Methods§

Source

fn take_ref(&self, n: usize) -> &[Self::Item]

Returns up to n items from the start of the slice.

Implementations on Foreign Types§

Source§

impl<T> TakeRef for [T]

Source§

type Item = T

Source§

fn take_ref(&self, n: usize) -> &[T]

Implementors§