struct ChunksExact
Declaration
template <class ItemT>
struct ChunksExact { /* full declaration omitted */ };
Description
An iterator over a slice in (non-overlapping) chunks (`chunk_size` elements at a time), starting at the beginning of the slice. When the slice len is not evenly divided by the chunk size, the last up to `chunk_size-1` elements will be omitted but can be retrieved from the remainder function from the iterator. This struct is created by the `chunks_exact()` method on slices.
Declared at: sus/collections/iterators/chunks.h:238
Templates
- ItemT
Method Overview
- public constexpr ::sus::num::usize exact_size_hint() const noexcept
- public constexpr Option<sus::collections::ChunksExact::Item> next() noexcept
- public constexpr Option<sus::collections::ChunksExact::Item> next_back() noexcept
- public sus::collections::ChunksExact::Item remainder() const &
- public constexpr ::sus::iter::SizeHint size_hint() const noexcept
Methods
¶constexpr ::sus::num::usize exact_size_hint()
const noexcept
constexpr ::sus::num::usize exact_size_hint()
const noexcept
Description
sus::iter::ExactSizeIterator trait.
Declared at: sus/collections/iterators/chunks.h:299
¶constexpr Option<
sus::collections::ChunksExact::Item>
next() noexcept
constexpr Option<
sus::collections::ChunksExact::Item>
next() noexcept
Declared at: sus/collections/iterators/chunks.h:256
¶constexpr Option<
sus::collections::ChunksExact::Item>
next_back() noexcept
constexpr Option<
sus::collections::ChunksExact::Item>
next_back() noexcept
Declared at: sus/collections/iterators/chunks.h:271
¶sus::collections::ChunksExact::Item remainder()
const&
sus::collections::ChunksExact::Item remainder()
const&
Description
Returns the remainder of the original slice that is not going to be returned by the iterator. The returned slice has at most `chunk_size-1` elements.
Declared at: sus/collections/iterators/chunks.h:253
¶constexpr ::sus::iter::SizeHint size_hint()
const noexcept
constexpr ::sus::iter::SizeHint size_hint()
const noexcept
Declared at: sus/collections/iterators/chunks.h:293