Crate copy_range

Source
Expand description

copy_range provides three structs: CopyRange, CopyRangeFrom, and CopyRangeInclusive.

They are similar to core::ops’s Range, RangeFrom, and RangeInclusive, respectively, except they implement Copy if their element type implements Copy, and they implement IntoIterator instead of Iterator.

They are freely convertible to and from their core::ops counterparts (with a note about RangeInclusive), and they implement most of the same (non-iterator-related) traits, notably RangeBounds.

Ranges of usize are additionally usable as the Index parameter for arrays, slices, string slices and (with the "alloc" feature enabled) Vec and String.

Structs§

CopyRange
A (half-open) range bounded inclusively below and exclusively above. See core::ops::Range.
CopyRangeFrom
A range only bounded inclusively below. See core::ops::RangeFrom.
CopyRangeInclusive
A range bounded inclusively above and below. See core::ops::RangeInclusive.

Type Aliases§

CopyRangeFull
core::ops::RangeFull is already Copy, so we just reexport it.
CopyRangeTo
core::ops::RangeTo is already Copy if Idx is Copy, so we just reexport it.
CopyRangeToInclusive
core::ops::RangeToInclusive is already Copy if Idx is Copy, so we just reexport it.