Struct rangemap::RangeInclusiveSet[][src]

pub struct RangeInclusiveSet<T, StepFnsT = T> { /* fields omitted */ }
Expand description

A set whose items are stored as ranges bounded inclusively below and above (start..=end).

See RangeInclusiveMap’s documentation for more details.

Implementations

Makes a new empty RangeInclusiveSet.

Makes a new empty RangeInclusiveSet, specifying successor and predecessor functions defined separately from T itself.

This is useful as a workaround for Rust’s “orphan rules”, which prevent you from implementing StepLite for T if T is a foreign type.

NOTE: This will likely be deprecated and then eventually removed once the standard library’s Step trait is stabilised, as most crates will then likely implement Step for their types where appropriate.

See this issue for details about that stabilization process.

Returns a reference to the range covering the given key, if any.

Returns true if any range in the set covers the specified value.

Gets an ordered iterator over all ranges, ordered by range.

Insert a range into the set.

If the inserted range either overlaps or is immediately adjacent any existing range, then the ranges will be coalesced into a single contiguous range.

Panics

Panics if range start > end.

Removes a range from the set, if all or any of it was present.

If the range to be removed partially overlaps any ranges in the set, then those ranges will be contracted to no longer cover the removed range.

Panics

Panics if range start > end.

Gets an iterator over all the maximally-sized ranges contained in outer_range that are not covered by any range stored in the set.

The iterator element type is RangeInclusive<T>.

NOTE: Calling gaps eagerly finds the first gap, even if the iterator is never consumed.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Extends a collection with the contents of an iterator. Read more

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

Extends a collection with exactly one element.

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

Reserves capacity in a collection for the given number of additional elements. Read more

Creates a value from an iterator. 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

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

Performs the conversion.

Performs the conversion.

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)

recently added

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.