Struct range_set_blaze::RangeMapBlaze

source ·
pub struct RangeMapBlaze<T: Integer, V: ValueOwned> { /* private fields */ }
Expand description

A set of integers stored as sorted & disjoint ranges.

Internally, it stores the ranges in a cache-efficient BTreeMap.

§Table of Contents

§RangeMapBlaze Constructors

You can also create RangeMapBlaze’s from unsorted and overlapping integers (or ranges). However, if you know that your input is sorted and disjoint, you can speed up construction.

Here are the constructors, followed by a description of the performance, and then some examples.

MethodsInputNotes
new/default
[from_iter][1]/[collect][1]integer iterator
[from_iter][2]/[collect][2]ranges iterator
[from_slice][5]slice of integersFast, but nightly-only
[from_sorted_disjoint][3]/[into_range_set_blaze2][3]SortedDisjointMap iterator
cmk from sorted starts
[from][4] /[into][4]array of integers

[1]: struct.RangeMapBlaze.html#impl-FromIterator<T, V, VR>-for-RangeMapBlaze<T, V> [2]: struct.RangeMapBlaze.html#impl-FromIterator<RangeInclusive<T, V, VR>>-for-RangeMapBlaze<T, V> [3]: RangeMapBlaze::from_sorted_disjoint [4]: RangeMapBlaze::from [5]: RangeMapBlaze::from_slice()

§Constructor Performance

The [from_iter][1]/[collect][1] constructors are designed to work fast on ‘clumpy’ data. By ‘clumpy’, we mean that the number of ranges needed to represent the data is small compared to the number of input integers. To understand this, consider the internals of the constructors:

Internally, the from_iter/collect constructors take these steps:

  • collect adjacent integers/ranges into disjoint ranges, O(n₁)
  • sort the disjoint ranges by their start, O(n₂ log n₂)
  • merge adjacent ranges, O(n₂)
  • create a BTreeMap from the now sorted & disjoint ranges, O(n₃ log n₃)

where n₁ is the number of input integers/ranges, n₂ is the number of disjoint & unsorted ranges, and n₃ is the final number of sorted & disjoint ranges.

For example, an input of

  • 3, 2, 1, 4, 5, 6, 7, 0, 8, 8, 8, 100, 1, becomes
  • 0..=8, 100..=100, 1..=1, and then
  • 0..=8, 1..=1, 100..=100, and finally
  • 0..=8, 100..=100.

What is the effect of clumpy data? Notice that if n₂ ≈ sqrt(n₁), then construction is O(n₁). (Indeed, as long as n₂n₁/ln(n₁), then construction is O(n₁).) Moreover, we’ll see that set operations are O(n₃). Thus, if n₃ ≈ sqrt(n₁) then set operations are O(sqrt(n₁)), a quadratic improvement an O(n₁) implementation that ignores the clumps.

The [from_slice][5] constructor typically provides a constant-time speed up for array-like collections of clumpy integers. On a representative benchmark, the speed up was 7×. The method works by scanning the input for blocks of consecutive integers, and then using from_iter on the results. Where available, it uses SIMD instructions. It is nightly only and enabled by the from_slice feature.

§Constructor Examples

use range_set_blaze::prelude::*;

// Create an empty set with 'new' or 'default'.
let a0 = RangeMapBlaze::<i32>::new();
let a1 = RangeMapBlaze::<i32>::default();
assert!(a0 == a1 && a0.is_empty());

// 'from_iter'/'collect': From an iterator of integers.
// Duplicates and out-of-order elements are fine.
let a0 = RangeMapBlaze::from_iter([3, 2, 1, 100, 1]);
let a1: RangeMapBlaze<i32> = [3, 2, 1, 100, 1].into_iter().collect();
assert!(a0 == a1 && a0.into_string() == "1..=3, 100..=100");

// 'from_iter'/'collect': From an iterator of inclusive ranges, start..=end.
// Overlapping, out-of-order, and empty ranges are fine.
#[allow(clippy::reversed_empty_ranges)]
let a0 = RangeMapBlaze::from_iter([1..=2, 2..=2, -10..=-5, 1..=0]);
#[allow(clippy::reversed_empty_ranges)]
let a1: RangeMapBlaze<i32> = [1..=2, 2..=2, -10..=-5, 1..=0].into_iter().collect();
assert!(a0 == a1 && a0.into_string() == "-10..=-5, 1..=2");

// 'from_slice': From any array-like collection of integers.
// Nightly-only, but faster than 'from_iter'/'collect' on integers.
#[cfg(feature = "from_slice")]
let a0 = RangeMapBlaze::from_slice(vec![3, 2, 1, 100, 1]);
#[cfg(feature = "from_slice")]
assert!(a0.into_string() == "1..=3, 100..=100");

// If we know the ranges are already sorted and disjoint,
// we can avoid work and use 'from'/'into'.
let a0 = RangeMapBlaze::from_sorted_disjoint(CheckSortedDisjoint::from([-10..=-5, 1..=2]));
let a1: RangeMapBlaze<i32> = CheckSortedDisjoint::from([-10..=-5, 1..=2]).into_range_set_blaze2();
assert!(a0 == a1 && a0.into_string() == "-10..=-5, 1..=2");

// For compatibility with `BTreeSet`, we also support
// 'from'/'into' from arrays of integers.
let a0 = RangeMapBlaze::from([3, 2, 1, 100, 1]);
let a1: RangeMapBlaze<i32> = [3, 2, 1, 100, 1].into();
assert!(a0 == a1 && a0.into_string() == "1..=3, 100..=100");

§RangeMapBlaze Set Operations

You can perform set operations on RangeMapBlazes using operators.

Set OperationOperatorMultiway Method
uniona | b[a, b, c].union()
intersectiona & b[a, b, c].intersection()
differencea - bn/a
symmetric differencea ^ bn/a
complement!an/a

RangeMapBlaze also implements many other methods, such as insert, pop_first and split_off. Many of these methods match those of BTreeSet.

§Set Operation Performance

Every operation is implemented as

  1. a single pass over the sorted & disjoint ranges
  2. the construction of a new RangeMapBlaze

Thus, applying multiple operators creates intermediate RangeMapBlaze’s. If you wish, you can avoid these intermediate RangeMapBlaze’s by switching to the SortedDisjointMap API. The last example below demonstrates this.

§Set Operation Examples

use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);

// Union of two 'RangeMapBlaze's.
let result = &a | &b;
// Alternatively, we can take ownership via 'a | b'.
assert_eq!(result.into_string(), "1..=100");

// Intersection of two 'RangeMapBlaze's.
let result = &a & &b; // Alternatively, 'a & b'.
assert_eq!(result.into_string(), "2..=2, 5..=6");

// Set difference of two 'RangeMapBlaze's.
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");

// Symmetric difference of two 'RangeMapBlaze's.
let result = &a ^ &b; // Alternatively, 'a ^ b'.
assert_eq!(result.into_string(), "1..=1, 3..=4, 7..=100");

// complement of a 'RangeMapBlaze'.
let result = !&a; // Alternatively, '!a'.
assert_eq!(
    result.into_string(),
    "-2147483648..=0, 3..=4, 101..=2147483647"
);

// Multiway union of 'RangeMapBlaze's.
let c = RangeMapBlaze::from_iter([2..=2, 6..=200]);
let result = [&a, &b, &c].union();
assert_eq!(result.into_string(), "1..=200");

// Multiway intersection of 'RangeMapBlaze's.
let result = [&a, &b, &c].intersection();
assert_eq!(result.into_string(), "2..=2, 6..=6");

// Applying multiple operators
let result0 = &a - (&b | &c); // Creates an intermediate 'RangeMapBlaze'.
// Alternatively, we can use the 'SortedDisjointMap' API and avoid the intermediate 'RangeMapBlaze'.
let result1 = RangeMapBlaze::from_sorted_disjoint(a.ranges() - (b.ranges() | c.ranges()));
assert!(result0 == result1 && result0.into_string() == "1..=1");

§RangeMapBlaze Comparisons

We can compare RangeMapBlazes using the following operators: <, <=, >, >=. Following the convention of BTreeSet, these comparisons are lexicographic. See cmp for more examples.

Use the is_subset and is_superset methods to check if one RangeMapBlaze is a subset or superset of another.

Use ==, != to check if two RangeMapBlazes are equal or not.

§Additional Examples

See the module-level documentation for additional examples.

Implementations§

source§

impl<T: Integer, V: ValueOwned> RangeMapBlaze<T, V>

source

pub fn iter(&self) -> IterMap<T, V, &V, RangeValuesIter<'_, T, V>>

Gets an (double-ended) iterator that visits the integer elements in the RangeMapBlaze in ascending and/or descending order.

Also see the RangeMapBlaze::ranges method.

§Examples
use range_set_blaze::RangeMapBlaze;

let set = RangeMapBlaze::from_iter([1..=3]);
let mut set_iter = set.iter();
assert_eq!(set_iter.next(), Some(1));
assert_eq!(set_iter.next(), Some(2));
assert_eq!(set_iter.next(), Some(3));
assert_eq!(set_iter.next(), None);

Values returned by .next() are in ascending order. Values returned by .next_back() are in descending order.

use range_set_blaze::RangeMapBlaze;

let set = RangeMapBlaze::from_iter([3, 1, 2]);
let mut set_iter = set.iter();
assert_eq!(set_iter.next(), Some(1));
assert_eq!(set_iter.next_back(), Some(3));
assert_eq!(set_iter.next(), Some(2));
assert_eq!(set_iter.next_back(), None);
source

pub fn keys(&self) -> KeysMap<T, V, &V, RangeValuesIter<'_, T, V>>

Gets an (double-ended) iterator that visits the integer elements in the RangeMapBlaze in ascending and/or descending order.

Also see the RangeMapBlaze::ranges method.

§Examples
use range_set_blaze::RangeMapBlaze;

let set = RangeMapBlaze::from_iter([1..=3]);
let mut set_iter = set.iter();
assert_eq!(set_iter.next(), Some(1));
assert_eq!(set_iter.next(), Some(2));
assert_eq!(set_iter.next(), Some(3));
assert_eq!(set_iter.next(), None);

Values returned by .next() are in ascending order. Values returned by .next_back() are in descending order.

use range_set_blaze::RangeMapBlaze;

let set = RangeMapBlaze::from_iter([3, 1, 2]);
let mut set_iter = set.iter();
assert_eq!(set_iter.next(), Some(1));
assert_eq!(set_iter.next_back(), Some(3));
assert_eq!(set_iter.next(), Some(2));
assert_eq!(set_iter.next_back(), None);
source

pub fn first_key_value(&self) -> Option<(T, &V)>

Returns the first element in the set, if any. This element is always the minimum of all integer elements in the set.

§Examples

Basic usage:

use range_set_blaze::RangeMapBlaze;

let mut set = RangeMapBlaze::new();
assert_eq!(set.first(), None);
set.insert(1);
assert_eq!(set.first(), Some(1));
set.insert(2);
assert_eq!(set.first(), Some(1));
source

pub fn get(&self, key: T) -> Option<&V>

Returns the element in the set, if any, that is equal to the value.

§Examples
use range_set_blaze::RangeMapBlaze;

let set = RangeMapBlaze::from_iter([1, 2, 3]);
assert_eq!(set.get(2), Some(2));
assert_eq!(set.get(4), None);
source

pub fn last_key_value(&self) -> Option<(T, &V)>

Returns the last element in the set, if any. This element is always the maximum of all elements in the set.

§Examples

Basic usage:

use range_set_blaze::RangeMapBlaze;

let mut set = RangeMapBlaze::new();
assert_eq!(set.last(), None);
set.insert(1);
assert_eq!(set.last(), Some(1));
set.insert(2);
assert_eq!(set.last(), Some(2));
source

pub fn from_sorted_disjoint_map<VR, I>(iter: I) -> Self
where VR: CloneBorrow<V>, I: SortedDisjointMap<T, V, VR>,

Create a RangeMapBlaze from a SortedDisjointMap iterator.

For more about constructors and performance, see RangeMapBlaze Constructors.

§Examples
use range_set_blaze::prelude::*;

let a0 = RangeMapBlaze::from_sorted_disjoint(CheckSortedDisjoint::from([-10..=-5, 1..=2]));
let a1: RangeMapBlaze<i32> = CheckSortedDisjoint::from([-10..=-5, 1..=2]).into_range_set_blaze2();
assert!(a0 == a1 && a0.into_string() == "-10..=-5, 1..=2");
source

pub fn append(&mut self, other: &mut Self)

Moves all elements from other into self, leaving other empty.

§Performance

It adds the integers in other to self in O(n log m) time, where n is the number of ranges in other and m is the number of ranges in self. When n is large, consider using | which is O(n+m) time.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut a = RangeMapBlaze::from_iter([1..=3]);
let mut b = RangeMapBlaze::from_iter([3..=5]);

a.append(&mut b);

assert_eq!(a.len(), 5usize);
assert_eq!(b.len(), 0usize);

assert!(a.contains(1));
assert!(a.contains(2));
assert!(a.contains(3));
assert!(a.contains(4));
assert!(a.contains(5));
source

pub fn clear(&mut self)

Clears the set, removing all integer elements.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut v = RangeMapBlaze::new();
v.insert(1);
v.clear();
assert!(v.is_empty());
source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut v = RangeMapBlaze::new();
assert!(v.is_empty());
v.insert(1);
assert!(!v.is_empty());
source

pub fn contains_key(&self, key: T) -> bool

Returns true if the set is a subset of another, i.e., other contains at least all the elements in self.

§Examples
use range_set_blaze::RangeMapBlaze;

let sup = RangeMapBlaze::from_iter([1..=3]);
let mut set = RangeMapBlaze::new();

assert_eq!(set.is_subset(&sup), true);
set.insert(2);
assert_eq!(set.is_subset(&sup), true);
set.insert(4);
assert_eq!(set.is_subset(&sup), false);

Returns true if the set is a superset of another, i.e., self contains at least all the elements in other.

§Examples
use range_set_blaze::RangeMapBlaze;

let sub = RangeMapBlaze::from_iter([1, 2]);
let mut set = RangeMapBlaze::new();

assert_eq!(set.is_superset(&sub), false);

set.insert(0);
set.insert(1);
assert_eq!(set.is_superset(&sub), false);

set.insert(2);
assert_eq!(set.is_superset(&sub), true);

Returns true if the set contains an element equal to the value.

§Examples
use range_set_blaze::RangeMapBlaze;

let set = RangeMapBlaze::from_iter([1, 2, 3]);
assert_eq!(set.contains(1), true);
assert_eq!(set.contains(4), false);
source

pub fn insert(&mut self, key: T, value: V) -> Option<V>

Adds a value to the set.

Returns whether the value was newly inserted. That is:

  • If the set did not previously contain an equal value, true is returned.
  • If the set already contained an equal value, false is returned, and the entry is not updated.
§Performance

Inserting n items will take in O(n log m) time, where n is the number of inserted items and m is the number of ranges in self. When n is large, consider using | which is O(n+m) time.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut set = RangeMapBlaze::new();

assert_eq!(set.insert(2), true);
assert_eq!(set.insert(2), false);
assert_eq!(set.len(), 1usize);
source

pub fn range<R>(&self, range: R) -> IntoIterMap<T, V>
where R: RangeBounds<T>,

Constructs an iterator over a sub-range of elements in the set.

Not to be confused with RangeMapBlaze::ranges, which returns an iterator over the ranges in the set.

The simplest way is to use the range syntax min..max, thus range(min..max) will yield elements from min (inclusive) to max (exclusive). The range may also be entered as (Bound<T, V, VR>, Bound<T, V, VR>), so for example range((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive range from 4 to 10.

§Panics

Panics if range start > end. Panics if range start == end and both bounds are Excluded.

§Performance

Although this could be written to run in time O(ln(n)) in the number of ranges, it is currently O(n) in the number of ranges.

§Examples
use range_set_blaze::RangeMapBlaze;
use core::ops::Bound::Included;

let mut set = RangeMapBlaze::new();
set.insert(3);
set.insert(5);
set.insert(8);
for elem in set.range((Included(4), Included(8))) {
    println!("{elem}");
}
assert_eq!(Some(5), set.range(4..).next());
source

pub fn ranges_insert(&mut self, range: RangeInclusive<T>, value: V) -> bool

Adds a range to the set.

Returns whether any values where newly inserted. That is:

  • If the set did not previously contain some value in the range, true is returned.
  • If the set already contained every value in the range, false is returned, and the entry is not updated.
§Performance

Inserting n items will take in O(n log m) time, where n is the number of inserted items and m is the number of ranges in self. When n is large, consider using | which is O(n+m) time.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut set = RangeMapBlaze::new();

assert_eq!(set.ranges_insert(2..=5), true);
assert_eq!(set.ranges_insert(5..=6), true);
assert_eq!(set.ranges_insert(3..=4), false);
assert_eq!(set.len(), 5usize);
source

pub fn remove(&mut self, key: T) -> Option<V>

If the set contains an element equal to the value, removes it from the set and drops it. Returns whether such an element was present.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut set = RangeMapBlaze::new();

set.insert(2);
assert!(set.remove(2));
assert!(!set.remove(2));
source

pub fn split_off(&mut self, key: T) -> Self

Splits the collection into two at the value. Returns a new collection with all elements greater than or equal to the value.

§Examples

Basic usage:

use range_set_blaze::RangeMapBlaze;

let mut a = RangeMapBlaze::new();
a.insert(1);
a.insert(2);
a.insert(3);
a.insert(17);
a.insert(41);

let b = a.split_off(3);

assert_eq!(a, RangeMapBlaze::from_iter([1, 2]));
assert_eq!(b, RangeMapBlaze::from_iter([3, 17, 41]));
source

pub fn take(&mut self, key: T) -> Option<V>

Removes and returns the element in the set, if any, that is equal to the value.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut set = RangeMapBlaze::from_iter([1, 2, 3]);
assert_eq!(set.take(2), Some(2));
assert_eq!(set.take(2), None);
source

pub const fn len(&self) -> <T as Integer>::SafeLen

Returns the number of elements in the set.

The number is allowed to be very, very large.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut v = RangeMapBlaze::new();
assert_eq!(v.len(), 0usize);
v.insert(1);
assert_eq!(v.len(), 1usize);

let v = RangeMapBlaze::from_iter([
    -170_141_183_460_469_231_731_687_303_715_884_105_728i128..=10,
    -10..=170_141_183_460_469_231_731_687_303_715_884_105_726,
]);
assert_eq!(
    v.len(),
    340_282_366_920_938_463_463_374_607_431_768_211_455u128
);
source

pub fn new() -> Self

Makes a new, empty RangeMapBlaze.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut set: RangeMapBlaze<i32> = RangeMapBlaze::new();
source

pub fn pop_first(&mut self) -> Option<(T, V)>
where V: Clone,

Removes the first element from the set and returns it, if any. The first element is always the minimum element in the set.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut set = RangeMapBlaze::new();

set.insert(1);
while let Some(n) = set.pop_first() {
    assert_eq!(n, 1);
}
assert!(set.is_empty());
source

pub fn pop_last(&mut self) -> Option<(T, V)>

Removes the last value from the set and returns it, if any. The last value is always the maximum value in the set.

§Examples
use range_set_blaze::RangeMapBlaze;

let mut set = RangeMapBlaze::new();

set.insert(1);
while let Some(n) = set.pop_last() {
    assert_eq!(n, 1);
}
assert!(set.is_empty());
source

pub fn range_values<'b>(&'b self) -> RangeValuesIter<'b, T, V>

An iterator that visits the ranges in the RangeMapBlaze, i.e., the integers as sorted & disjoint ranges.

Also see RangeMapBlaze::iter and [RangeMapBlaze::into_pairs].

§Examples
use range_set_blaze::RangeMapBlaze;

let set = RangeMapBlaze::from_iter([10..=20, 15..=25, 30..=40]);
let mut ranges = set.ranges();
assert_eq!(ranges.next(), Some(10..=25));
assert_eq!(ranges.next(), Some(30..=40));
assert_eq!(ranges.next(), None);

Values returned by the iterator are returned in ascending order:

use range_set_blaze::RangeMapBlaze;

let set = RangeMapBlaze::from_iter([30..=40, 15..=25, 10..=20]);
let mut ranges = set.ranges();
assert_eq!(ranges.next(), Some(10..=25));
assert_eq!(ranges.next(), Some(30..=40));
assert_eq!(ranges.next(), None);

men

source

pub fn into_range_values(self) -> IntoRangeValuesIter<T, V>

cmk doc

source

pub fn ranges(&self) -> MapRangesIter<'_, T, V>

cmk

source

pub fn into_ranges(self) -> MapIntoRangesIter<T, V>

cmk doc

source

pub fn complement_with(&self, value: V) -> RangeMapBlaze<T, V>

cmk cmk it’s going to clone the value

source

pub fn range_values_len(&self) -> usize

Returns the number of sorted & disjoint ranges in the set.

§Example
use range_set_blaze::RangeMapBlaze;

// We put in three ranges, but they are not sorted & disjoint.
let set = RangeMapBlaze::from_iter([10..=20, 15..=25, 30..=40]);
// After RangeMapBlaze sorts & 'disjoint's them, we see two ranges.
assert_eq!(set.ranges_len(), 2);
assert_eq!(set.into_string(), "10..=25, 30..=40");
source

pub fn intersection_with_set( &self, other: &RangeSetBlaze<T> ) -> RangeMapBlaze<T, V>

cmk doc

Trait Implementations§

source§

impl<T, V> BitAnd<&RangeMapBlaze<T, V>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitand(self, rhs: &RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Intersects the contents of two RangeMapBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);
let result = &a & &b; // Alternatively, 'a & b'.
assert_eq!(result.into_string(), "2..=2, 5..=6");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the & operator.
source§

impl<T, V> BitAnd<&RangeMapBlaze<T, V>> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitand(self, rhs: &RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Intersects the contents of two RangeMapBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);
let result = &a & &b; // Alternatively, 'a & b'.
assert_eq!(result.into_string(), "2..=2, 5..=6");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the & operator.
source§

impl<T, V> BitAnd<&RangeSetBlaze<T>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitand(self, rhs: &RangeSetBlaze<T>) -> RangeMapBlaze<T, V>

cmk

§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the & operator.
source§

impl<T, V> BitAnd<&RangeSetBlaze<T>> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitand(self, rhs: &RangeSetBlaze<T>) -> RangeMapBlaze<T, V>

cmk

§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the & operator.
source§

impl<T, V> BitAnd<RangeMapBlaze<T, V>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitand(self, rhs: RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Intersects the contents of two RangeMapBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);
let result = &a & &b; // Alternatively, 'a & b'.
assert_eq!(result.into_string(), "2..=2, 5..=6");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the & operator.
source§

impl<T, V> BitAnd<RangeSetBlaze<T>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitand(self, rhs: RangeSetBlaze<T>) -> RangeMapBlaze<T, V>

cmk

§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the & operator.
source§

impl<T, V> BitAnd<RangeSetBlaze<T>> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitand(self, rhs: RangeSetBlaze<T>) -> RangeMapBlaze<T, V>

cmk

§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the & operator.
source§

impl<T, V> BitAnd for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitand(self, rhs: RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Intersects the contents of two RangeMapBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);
let result = &a & &b; // Alternatively, 'a & b'.
assert_eq!(result.into_string(), "2..=2, 5..=6");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the & operator.
source§

impl<T: Integer, V: ValueOwned> BitOr<&RangeMapBlaze<T, V>> for &RangeMapBlaze<T, V>

source§

fn bitor(self, other: &RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Unions the contents of two RangeMapBlaze’s.

Passing ownership rather than borrow sometimes allows a many-times faster speed up.

§Examples
use range_set_blaze::RangeMapBlaze;
let mut a = RangeMapBlaze::from_iter([1..=4]);
let mut b = RangeMapBlaze::from_iter([0..=0,3..=5,10..=10]);
let union = &a | &b;
assert_eq!(union, RangeMapBlaze::from_iter([0..=5, 10..=10]));
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the | operator.
source§

impl<T: Integer, V: ValueOwned> BitOr<&RangeMapBlaze<T, V>> for RangeMapBlaze<T, V>

§

type Output = RangeMapBlaze<T, V>

Unions the contents of two RangeMapBlaze’s.

Passing ownership rather than borrow sometimes allows a many-times faster speed up.

§Examples
use range_set_blaze::RangeMapBlaze;
let mut a = RangeMapBlaze::from_iter([1..=4]);
let mut b = RangeMapBlaze::from_iter([0..=0,3..=5,10..=10]);
let union = a | &b;
assert_eq!(union, RangeMapBlaze::from_iter([0..=5, 10..=10]));
source§

fn bitor(self, other: &Self) -> RangeMapBlaze<T, V>

Performs the | operation. Read more
source§

impl<T: Integer, V: ValueOwned> BitOr<RangeMapBlaze<T, V>> for &RangeMapBlaze<T, V>

source§

fn bitor(self, other: RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Unions the contents of two RangeMapBlaze’s.

Passing ownership rather than borrow sometimes allows a many-times faster speed up.

§Examples
use range_set_blaze::RangeMapBlaze;
let mut a = RangeMapBlaze::from_iter([1..=4]);
let mut b = RangeMapBlaze::from_iter([0..=0,3..=5,10..=10]);
let union = &a | b;
assert_eq!(union, RangeMapBlaze::from_iter([0..=5, 10..=10]));
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the | operator.
source§

impl<T: Integer, V: ValueOwned> BitOr for RangeMapBlaze<T, V>

§

type Output = RangeMapBlaze<T, V>

Unions the contents of two RangeMapBlaze’s.

Passing ownership rather than borrow sometimes allows a many-times faster speed up.

§Examples
use range_set_blaze::RangeMapBlaze;
let a = RangeMapBlaze::from_iter([1..=4]);
let b = RangeMapBlaze::from_iter([0..=0, 3..=5, 10..=10]);
let union = a | b;
assert_eq!(union, RangeMapBlaze::from_iter([0..=5, 10..=10]));
source§

fn bitor(self, other: Self) -> RangeMapBlaze<T, V>

Performs the | operation. Read more
source§

impl<T, V> BitXor<&RangeMapBlaze<T, V>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitxor(self, rhs: &RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Symmetric difference the contents of two RangeMapBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);
let result = &a ^ &b; // Alternatively, 'a ^ b'.
assert_eq!(result.into_string(), "1..=1, 3..=4, 7..=100");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the ^ operator.
source§

impl<T, V> BitXor<&RangeMapBlaze<T, V>> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitxor(self, rhs: &RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Symmetric difference the contents of two RangeMapBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);
let result = &a ^ &b; // Alternatively, 'a ^ b'.
assert_eq!(result.into_string(), "1..=1, 3..=4, 7..=100");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the ^ operator.
source§

impl<T, V> BitXor<RangeMapBlaze<T, V>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitxor(self, rhs: RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Symmetric difference the contents of two RangeMapBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);
let result = &a ^ &b; // Alternatively, 'a ^ b'.
assert_eq!(result.into_string(), "1..=1, 3..=4, 7..=100");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the ^ operator.
source§

impl<T, V> BitXor for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn bitxor(self, rhs: RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Symmetric difference the contents of two RangeMapBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([1..=2, 5..=100]);
let b = RangeMapBlaze::from_iter([2..=6]);
let result = &a ^ &b; // Alternatively, 'a ^ b'.
assert_eq!(result.into_string(), "1..=1, 3..=4, 7..=100");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the ^ operator.
source§

impl<T: Clone + Integer, V: Clone + ValueOwned> Clone for RangeMapBlaze<T, V>

source§

fn clone(&self) -> RangeMapBlaze<T, V>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Integer, V: ValueOwned + Debug> Debug for RangeMapBlaze<T, V>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default + Integer, V: Default + ValueOwned> Default for RangeMapBlaze<T, V>

source§

fn default() -> RangeMapBlaze<T, V>

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

impl<T: Integer, V: ValueOwned + Debug> Display for RangeMapBlaze<T, V>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, V> Extend<(T, V)> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn extend<I>(&mut self, iter: I)
where I: IntoIterator<Item = (T, V)>,

Extends the RangeSetBlaze with the contents of a range iterator. cmk this has right-to-left priority – like BTreeMap, but unlike most other RangeSetBlaze methods. Elements are added one-by-one. There is also a version that takes an integer iterator.

The |= operator extends a RangeSetBlaze from another RangeSetBlaze. It is never slower than RangeSetBlaze::extend and often several times faster.

§Examples
use range_set_blaze::RangeSetBlaze;
let mut a = RangeSetBlaze::from_iter([1..=4]);
a.extend([5..=5, 0..=0, 0..=0, 3..=4, 10..=10]);
assert_eq!(a, RangeSetBlaze::from_iter([0..=5, 10..=10]));

let mut a = RangeSetBlaze::from_iter([1..=4]);
let mut b = RangeSetBlaze::from_iter([5..=5, 0..=0, 0..=0, 3..=4, 10..=10]);
a |= b;
assert_eq!(a, RangeSetBlaze::from_iter([0..=5, 10..=10]));
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, V, const N: usize> From<[(T, V); N]> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn from(arr: [(T, V); N]) -> Self

For compatibility with BTreeSet you may create a RangeSetBlaze from an array of integers.

For more about constructors and performance, see RangeSetBlaze Constructors.

§Examples
use range_set_blaze::RangeSetBlaze;

let a0 = RangeSetBlaze::from([3, 2, 1, 100, 1]);
let a1: RangeSetBlaze<i32> = [3, 2, 1, 100, 1].into();
assert!(a0 == a1 && a0.into_string() == "1..=3, 100..=100")
source§

impl<'a, T, V> FromIterator<(RangeInclusive<T>, &'a V)> for RangeMapBlaze<T, V>
where T: Integer + 'a, V: ValueOwned + 'a,

source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = (RangeInclusive<T>, &'a V)>,

Create a RangeMapBlaze from an iterator of inclusive ranges, start..=end. Overlapping, out-of-order, and empty ranges are fine.

For more about constructors and performance, see RangeMapBlaze Constructors.

§Examples
use range_set_blaze::RangeMapBlaze;

#[allow(clippy::reversed_empty_ranges)]
let a0 = RangeMapBlaze::from_iter([1..=2, 2..=2, -10..=-5, 1..=0]);
#[allow(clippy::reversed_empty_ranges)]
let a1: RangeMapBlaze<i32> = [1..=2, 2..=2, -10..=-5, 1..=0].into_iter().collect();
assert!(a0 == a1 && a0.into_string() == "-10..=-5, 1..=2");
source§

impl<T: Integer, V: ValueOwned> FromIterator<(RangeInclusive<T>, V)> for RangeMapBlaze<T, V>

source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = (RangeInclusive<T>, V)>,

Create a RangeMapBlaze from an iterator of inclusive ranges, start..=end. Overlapping, out-of-order, and empty ranges are fine.

For more about constructors and performance, see RangeMapBlaze Constructors.

§Examples
use range_set_blaze::RangeMapBlaze;

#[allow(clippy::reversed_empty_ranges)]
let vec_range = vec![1..=2, 2..=2, -10..=-5, 1..=0];
let a0 = RangeMapBlaze::from_iter(vec_range.iter());
let a1: RangeMapBlaze<i32> = vec_range.iter().collect();
assert!(a0 == a1 && a0.into_string() == "-10..=-5, 1..=2");
source§

impl<'a, T, V> FromIterator<(T, &'a V)> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned + 'a,

source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = (T, &'a V)>,

Create a RangeMapBlaze from an iterator of integers. Duplicates and out-of-order elements are fine.

For more about constructors and performance, see RangeMapBlaze Constructors.

§Examples
use range_set_blaze::RangeMapBlaze;

let a0 = RangeMapBlaze::from_iter([3, 2, 1, 100, 1]);
let a1: RangeMapBlaze<i32> = [3, 2, 1, 100, 1].into_iter().collect();
assert!(a0 == a1 && a0.into_string() == "1..=3, 100..=100");
source§

impl<T: Integer, V: ValueOwned> FromIterator<(T, V)> for RangeMapBlaze<T, V>

source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = (T, V)>,

Create a RangeMapBlaze from an iterator of inclusive ranges, start..=end. Overlapping, out-of-order, and empty ranges are fine.

For more about constructors and performance, see RangeMapBlaze Constructors.

§Examples
use range_set_blaze::RangeMapBlaze;

#[allow(clippy::reversed_empty_ranges)]
let vec_range = vec![1..=2, 2..=2, -10..=-5, 1..=0];
let a0 = RangeMapBlaze::from_iter(vec_range.iter());
let a1: RangeMapBlaze<i32> = vec_range.iter().collect();
assert!(a0 == a1 && a0.into_string() == "-10..=-5, 1..=2");
source§

impl<T: Hash + Integer, V: Hash + ValueOwned> Hash for RangeMapBlaze<T, V>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl<T, V> IntoIterator for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn into_iter(self) -> IntoIterMap<T, V>

Gets a (double-ended) iterator for moving out the RangeSetBlaze’s integer contents.

§Examples
use range_set_blaze::RangeSetBlaze;

let set = RangeSetBlaze::from_iter([1, 2, 3, 4]);

let v: Vec<_> = set.into_iter().collect();
assert_eq!(v, [1, 2, 3, 4]);

let set = RangeSetBlaze::from_iter([1, 2, 3, 4]);
let v: Vec<_> = set.into_iter().rev().collect();
assert_eq!(v, [4, 3, 2, 1]);
§

type Item = (T, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIterMap<T, V>

Which kind of iterator are we turning this into?
source§

impl<T, V> Not for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn not(self) -> RangeSetBlaze<T>

cmk

§

type Output = RangeSetBlaze<T>

The resulting type after applying the ! operator.
source§

impl<T, V> Not for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn not(self) -> RangeSetBlaze<T>

cmk

§

type Output = RangeSetBlaze<T>

The resulting type after applying the ! operator.
source§

impl<T: PartialEq + Integer, V: PartialEq + ValueOwned> PartialEq for RangeMapBlaze<T, V>

source§

fn eq(&self, other: &RangeMapBlaze<T, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, V> Sub<&RangeMapBlaze<T, V>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn sub(self, rhs: &RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Difference the contents of two RangeSetBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeSetBlaze::from_iter([1..=2, 5..=100]);
let b = RangeSetBlaze::from_iter([2..=6]);
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the - operator.
source§

impl<T, V> Sub<&RangeMapBlaze<T, V>> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn sub(self, rhs: &RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Difference the contents of two RangeSetBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeSetBlaze::from_iter([1..=2, 5..=100]);
let b = RangeSetBlaze::from_iter([2..=6]);
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the - operator.
source§

impl<T, V> Sub<&RangeSetBlaze<T>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn sub(self, rhs: &RangeSetBlaze<T>) -> RangeMapBlaze<T, V>

Difference the contents of two RangeSetBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeSetBlaze::from_iter([1..=2, 5..=100]);
let b = RangeSetBlaze::from_iter([2..=6]);
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");

cmk

§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the - operator.
source§

impl<T, V> Sub<&RangeSetBlaze<T>> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn sub(self, rhs: &RangeSetBlaze<T>) -> RangeMapBlaze<T, V>

Difference the contents of two RangeSetBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeSetBlaze::from_iter([1..=2, 5..=100]);
let b = RangeSetBlaze::from_iter([2..=6]);
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");

cmk

§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the - operator.
source§

impl<T, V> Sub<RangeMapBlaze<T, V>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn sub(self, rhs: RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Difference the contents of two RangeSetBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeSetBlaze::from_iter([1..=2, 5..=100]);
let b = RangeSetBlaze::from_iter([2..=6]);
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the - operator.
source§

impl<T, V> Sub<RangeSetBlaze<T>> for &RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn sub(self, rhs: RangeSetBlaze<T>) -> RangeMapBlaze<T, V>

Difference the contents of two RangeSetBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeSetBlaze::from_iter([1..=2, 5..=100]);
let b = RangeSetBlaze::from_iter([2..=6]);
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");

cmk

§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the - operator.
source§

impl<T, V> Sub<RangeSetBlaze<T>> for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn sub(self, rhs: RangeSetBlaze<T>) -> RangeMapBlaze<T, V>

Difference the contents of two RangeSetBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeSetBlaze::from_iter([1..=2, 5..=100]);
let b = RangeSetBlaze::from_iter([2..=6]);
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");

cmk

§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the - operator.
source§

impl<T, V> Sub for RangeMapBlaze<T, V>
where T: Integer, V: ValueOwned,

source§

fn sub(self, rhs: RangeMapBlaze<T, V>) -> RangeMapBlaze<T, V>

Difference the contents of two RangeSetBlaze’s.

Either, neither, or both inputs may be borrowed.

§Examples
use range_set_blaze::prelude::*;

let a = RangeSetBlaze::from_iter([1..=2, 5..=100]);
let b = RangeSetBlaze::from_iter([2..=6]);
let result = &a - &b; // Alternatively, 'a - b'.
assert_eq!(result.into_string(), "1..=1, 7..=100");
§

type Output = RangeMapBlaze<T, V>

The resulting type after applying the - operator.
source§

impl<T: Integer, V: ValueOwned> StructuralPartialEq for RangeMapBlaze<T, V>

Auto Trait Implementations§

§

impl<T, V> Freeze for RangeMapBlaze<T, V>
where <T as Integer>::SafeLen: Freeze,

§

impl<T, V> RefUnwindSafe for RangeMapBlaze<T, V>

§

impl<T, V> Send for RangeMapBlaze<T, V>
where V: Send,

§

impl<T, V> Sync for RangeMapBlaze<T, V>
where <T as Integer>::SafeLen: Sync, V: Sync,

§

impl<T, V> Unpin for RangeMapBlaze<T, V>
where <T as Integer>::SafeLen: Unpin,

§

impl<T, V> UnwindSafe for RangeMapBlaze<T, V>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ValueOwned for T
where T: PartialEq + Clone,