Struct slice_cell::SliceCell

source ·
#[repr(transparent)]
pub struct SliceCell<T> { /* private fields */ }
Expand description

A Cell<[T]>-like type that has some additional slice-like API.

References to this type can be gotten from dereferencing an ArrayCell<T, N>, or using from_mut.

Under the assume_cell_layout cargo feature, this type can be converted to and from Cell<[T]> and [Cell<T>] in several ways.

Implementations§

View this SliceCell as a Cell of a slice.

View this SliceCell as a slice of Cells.

View a Cell of a slice as a SliceCell.

View a slice Cells as a SliceCell.

View this SliceCell as a Cell of a slice.

View this SliceCell as a slice of Cells.

View a Cell of a slice as a SliceCell.

View this SliceCell as a Cell of a slice.

View this SliceCell as a slice of Cells.

View a Cell of a slice as a SliceCell.

View this SliceCell as a Cell of a slice.

View this SliceCell as a slice of Cells.

View a Cell of a slice as a SliceCell.

Returns a raw pointer to the underlying data in this SliceCell.

Unwraps a boxed SliceCell into a slice.

Wraps a boxed slice in a SliceCell.

Wraps a reference-counted slice in a SliceCell, if it is uniquely owned.

Unwraps a reference-counted SliceCell into an slice, if it is uniquely owned.

Unwraps a uniquely borrowed SliceCell into a slice.

Wraps a uniquely borrowed slice in a SliceCell.

Returns the length of the SliceCell.

Divide one SliceCell into two at an index.

Panics if mid > self.len().

See slice::split_at

Divide one mutable SliceCell into two at an index.

Panics if mid > self.len().

See slice::split_at_mut

Returns the first and all the rest of the elements of the SliceCell, or None if it is empty.

See slice::split_first

Returns the first and all the rest of the elements of the SliceCell, or None if it is empty.

See slice::split_first_mut

Returns the last and all the rest of the elements of the SliceCell, or None if it is empty.

See slice::split_last

Returns the last and all the rest of the elements of the SliceCell, or None if it is empty.

See slice::split_last_mut

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

See slice::copy_from_slice.

Clones all elements from src into self.

The length of src must be the same as self.

See slice::copy_from_slice.

Take all elements from this SliceCell into a mutable slice, leaving T::default() in each cell

Take all elements from this SliceCell into a newly allocated Vec<T>, leaving T::default() in each cell.

Copy all elements from this SliceCell into a mutable slice.

Copy all elements from this SliceCell into a newly allocated Vec<T>.

Swaps two elements in the slice.

See <[T]>::swap.

Fills self with elements by cloning value.

See also: <[T]>::fill.

Fills self with elements returned by calling a closure repeatedly.

See also: <[T]>::fill_with.

Replacement for TryFrom impl, since Rc is not fundamental

N should not be 0.

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

N should not be 0.

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

N should not be 0.

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

N should not be 0.

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

Trait Implementations§

Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation. Read more
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
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
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Read all bytes until EOF in this source, placing them into buf. Read more
Like read, except that it reads into a slice of buffers. Read more
🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored implementation. Read more
Read all bytes until EOF in this source, appending them to buf. Read more
Read the exact number of bytes required to fill buf. Read more
🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
🔬This is a nightly-only experimental API. (read_buf)
Read the exact number of bytes required to fill cursor. Read more
Creates a “by reference” adaptor for this instance of Read. Read more
Transforms this Read instance to an Iterator over its bytes. Read more
Creates an adapter which will chain this stream with another. Read more
Creates an adapter which will read at most limit bytes from it. 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.
Write a buffer into this writer, returning how many bytes were written. Read more
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
Like write, except that it writes from a slice of buffers. Read more
🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
Attempts to write an entire buffer into this writer. Read more
🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Creates a “by reference” adapter for this instance of Write. 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