pub struct Slice<'a, A, const N: usize> { /* private fields */ }
Expand description

An indexable representation of a subset of a RingBuffer.

Implementations

Get an unchecked reference to the value at the given index.

Safety

You must ensure the index is not out of bounds.

Get an iterator over references to the items in the slice in order.

Create a subslice of this slice.

This consumes the slice. To create a subslice without consuming it, clone it first: my_slice.clone().slice(1..2).

Split the slice into two subslices at the given index.

Construct a new RingBuffer by copying the elements in this slice.

Trait Implementations

Get a reference to the value at a given index.

Get a reference to the first element in the array.

Get a reference to the last element in the array.

Return true if an element equivalent to target exists in the array.

Perform a binary search for target.

Perform a binary search using a comparator function.

Perform a binary search using a key and a key extractor function.

Test whether the array is sorted.

Test whether the array is sorted using a comparator function.

Test whether the array is sorted using a key extractor function.

Test whether the array starts with the elements in slice.

Test whether the array ends with the elements in slice.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Get the length of the slice.

Return whether the data structure is empty.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Converts this type into the (usually inferred) input type.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.