Expand description
A finite heterogeneous sequence, (T, U, ..)
.
Let’s cover each of those in turn:
Tuples are finite. In other words, a tuple has a length. Here’s a tuple
of length 3
:
("hello", 5, 'c');
Run‘Length’ is also sometimes called ‘arity’ here; each tuple of a different length is a different, distinct type.
Tuples are heterogeneous. This means that each element of the tuple can have a different type. In that tuple above, it has the type:
(&'static str, i32, char)
RunTuples are a sequence. This means that they can be accessed by position; this is called ‘tuple indexing’, and it looks like this:
let tuple = ("hello", 5, 'c');
assert_eq!(tuple.0, "hello");
assert_eq!(tuple.1, 5);
assert_eq!(tuple.2, 'c');
RunThe sequential nature of the tuple applies to its implementations of various
traits. For example, in PartialOrd
and Ord
, the elements are compared
sequentially until the first non-equal set is found.
For more about tuples, see the book.
Trait implementations
If every type inside a tuple implements one of the following traits, then a tuple itself also implements it.
Due to a temporary restriction in Rust’s type system, these traits are only implemented on tuples of arity 12 or less. In the future, this may change.
Examples
Basic usage:
let tuple = ("hello", 5, 'c');
assert_eq!(tuple.0, "hello");
RunTuples are often used as a return type when you want to return more than one value:
fn calculate_point() -> (i32, i32) {
// Don't do a calculation, that's not the point of the example
(4, 5)
}
let point = calculate_point();
assert_eq!(point.0, 4);
assert_eq!(point.1, 5);
// Combining this with patterns can be nicer.
let (x, y) = calculate_point();
assert_eq!(x, 4);
assert_eq!(y, 5);
RunTrait Implementations
sourceimpl<T0: Debug, T1: Debug, T2: Debug, T3: Debug, T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
impl<T0: Debug, T1: Debug, T2: Debug, T3: Debug, T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<T1: Debug, T2: Debug, T3: Debug, T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
impl<T1: Debug, T2: Debug, T3: Debug, T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<T2: Debug, T3: Debug, T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
impl<T2: Debug, T3: Debug, T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<T3: Debug, T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
impl<T3: Debug, T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
impl<T4: Debug, T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T4, T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
impl<T5: Debug, T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T5, T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
impl<T6: Debug, T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T6, T7, T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T7, T8, T9, T10, T11) where
T11: ?Sized,
impl<T7: Debug, T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T7, T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T8, T9, T10, T11) where
T11: ?Sized,
impl<T8: Debug, T9: Debug, T10: Debug, T11: Debug> Debug for (T8, T9, T10, T11) where
T11: ?Sized,
sourceimpl<B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (B, C, D, E, F, G, H, I, J, K, L)
impl<B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (B, C, D, E, F, G, H, I, J, K, L)
sourceimpl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (A, B, C, D, E, F, G, H, I, J, K, L)
impl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (A, B, C, D, E, F, G, H, I, J, K, L)
sourceimpl<G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (G, H, I, J, K, L)
impl<G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (G, H, I, J, K, L)
sourceimpl<F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (F, G, H, I, J, K, L)
impl<F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (F, G, H, I, J, K, L)
sourceimpl<E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (E, F, G, H, I, J, K, L)
impl<E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (E, F, G, H, I, J, K, L)
sourceimpl<D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (D, E, F, G, H, I, J, K, L)
impl<D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (D, E, F, G, H, I, J, K, L)
sourceimpl<C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (C, D, E, F, G, H, I, J, K, L)
impl<C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default, L: Default> Default for (C, D, E, F, G, H, I, J, K, L)
1.56.0 · sourceimpl<A, B, ExtendA, ExtendB> Extend<(A, B)> for (ExtendA, ExtendB) where
ExtendA: Extend<A>,
ExtendB: Extend<B>,
impl<A, B, ExtendA, ExtendB> Extend<(A, B)> for (ExtendA, ExtendB) where
ExtendA: Extend<A>,
ExtendB: Extend<B>,
sourcefn extend<T: IntoIterator<Item = (A, B)>>(&mut self, into_iter: T)
fn extend<T: IntoIterator<Item = (A, B)>>(&mut self, into_iter: T)
Allows to extend
a tuple of collections that also implement Extend
.
See also: Iterator::unzip
Examples
let mut tuple = (vec![0], vec![1]);
tuple.extend([(2, 3), (4, 5), (6, 7)]);
assert_eq!(tuple.0, [0, 2, 4, 6]);
assert_eq!(tuple.1, [1, 3, 5, 7]);
// also allows for arbitrarily nested tuples as elements
let mut nested_tuple = (vec![1], (vec![2], vec![3]));
nested_tuple.extend([(4, (5, 6)), (7, (8, 9))]);
let (a, (b, c)) = nested_tuple;
assert_eq!(a, [1, 4, 7]);
assert_eq!(b, [2, 5, 8]);
assert_eq!(c, [3, 6, 9]);
Runsourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash> Hash for (A, B, C, D, E, F, G, H, I, J, K) where
K: ?Sized,
impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash> Hash for (A, B, C, D, E, F, G, H, I, J, K) where
K: ?Sized,
sourceimpl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash, L: Hash> Hash for (A, B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash, L: Hash> Hash for (A, B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourceimpl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash> Hash for (A, B, C, D, E, F) where
F: ?Sized,
impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash> Hash for (A, B, C, D, E, F) where
F: ?Sized,
sourceimpl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash> Hash for (A, B, C, D, E, F, G) where
G: ?Sized,
impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash> Hash for (A, B, C, D, E, F, G) where
G: ?Sized,
sourceimpl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash> Hash for (A, B, C, D, E, F, G, H) where
H: ?Sized,
impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash> Hash for (A, B, C, D, E, F, G, H) where
H: ?Sized,
sourceimpl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash> Hash for (A, B, C, D, E, F, G, H, I) where
I: ?Sized,
impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash> Hash for (A, B, C, D, E, F, G, H, I) where
I: ?Sized,
sourceimpl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash> Hash for (A, B, C, D, E, F, G, H, I, J) where
J: ?Sized,
impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash> Hash for (A, B, C, D, E, F, G, H, I, J) where
J: ?Sized,
sourceimpl<L: Ord> Ord for (L,) where
L: ?Sized,
impl<L: Ord> Ord for (L,) where
L: ?Sized,
sourceimpl<K: Ord, L: Ord> Ord for (K, L) where
L: ?Sized,
impl<K: Ord, L: Ord> Ord for (K, L) where
L: ?Sized,
sourceimpl<B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (A, B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (A, B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<J: Ord, K: Ord, L: Ord> Ord for (J, K, L) where
L: ?Sized,
impl<J: Ord, K: Ord, L: Ord> Ord for (J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<I: Ord, J: Ord, K: Ord, L: Ord> Ord for (I, J, K, L) where
L: ?Sized,
impl<I: Ord, J: Ord, K: Ord, L: Ord> Ord for (I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (H, I, J, K, L) where
L: ?Sized,
impl<H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (H, I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (G, H, I, J, K, L) where
L: ?Sized,
impl<G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (G, H, I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (F, G, H, I, J, K, L) where
L: ?Sized,
impl<F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (F, G, H, I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (E, F, G, H, I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (D, E, F, G, H, I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
1.21.0 · sourcefn max(self, other: Self) -> Self where
Self: Sized,
fn max(self, other: Self) -> Self where
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(A, B, C, D, E, F, G, H, I, J, K, L)> for (A, B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(A, B, C, D, E, F, G, H, I, J, K, L)> for (A, B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourceimpl<B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(B, C, D, E, F, G, H, I, J, K, L)> for (B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(B, C, D, E, F, G, H, I, J, K, L)> for (B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourceimpl<C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(C, D, E, F, G, H, I, J, K, L)> for (C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(C, D, E, F, G, H, I, J, K, L)> for (C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourceimpl<D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(D, E, F, G, H, I, J, K, L)> for (D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(D, E, F, G, H, I, J, K, L)> for (D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourceimpl<E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(E, F, G, H, I, J, K, L)> for (E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(E, F, G, H, I, J, K, L)> for (E, F, G, H, I, J, K, L) where
L: ?Sized,
sourceimpl<F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(F, G, H, I, J, K, L)> for (F, G, H, I, J, K, L) where
L: ?Sized,
impl<F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(F, G, H, I, J, K, L)> for (F, G, H, I, J, K, L) where
L: ?Sized,
sourceimpl<G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(G, H, I, J, K, L)> for (G, H, I, J, K, L) where
L: ?Sized,
impl<G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(G, H, I, J, K, L)> for (G, H, I, J, K, L) where
L: ?Sized,
sourceimpl<H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(H, I, J, K, L)> for (H, I, J, K, L) where
L: ?Sized,
impl<H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(H, I, J, K, L)> for (H, I, J, K, L) where
L: ?Sized,
sourceimpl<I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(I, J, K, L)> for (I, J, K, L) where
L: ?Sized,
impl<I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(I, J, K, L)> for (I, J, K, L) where
L: ?Sized,
sourceimpl<J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(J, K, L)> for (J, K, L) where
L: ?Sized,
impl<J: PartialEq, K: PartialEq, L: PartialEq> PartialEq<(J, K, L)> for (J, K, L) where
L: ?Sized,
sourceimpl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(A, B, C, D, E, F, G, H, I, J, K, L)> for (A, B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(A, B, C, D, E, F, G, H, I, J, K, L)> for (A, B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(
&self,
other: &(A, B, C, D, E, F, G, H, I, J, K, L)
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &(A, B, C, D, E, F, G, H, I, J, K, L)
) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(A, B, C, D, E, F, G, H, I, J, K, L)) -> bool
fn lt(&self, other: &(A, B, C, D, E, F, G, H, I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(A, B, C, D, E, F, G, H, I, J, K, L)) -> bool
fn le(&self, other: &(A, B, C, D, E, F, G, H, I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(B, C, D, E, F, G, H, I, J, K, L)> for (B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(B, C, D, E, F, G, H, I, J, K, L)> for (B, C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(
&self,
other: &(B, C, D, E, F, G, H, I, J, K, L)
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &(B, C, D, E, F, G, H, I, J, K, L)
) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(B, C, D, E, F, G, H, I, J, K, L)) -> bool
fn lt(&self, other: &(B, C, D, E, F, G, H, I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(B, C, D, E, F, G, H, I, J, K, L)) -> bool
fn le(&self, other: &(B, C, D, E, F, G, H, I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(C, D, E, F, G, H, I, J, K, L)> for (C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(C, D, E, F, G, H, I, J, K, L)> for (C, D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(
&self,
other: &(C, D, E, F, G, H, I, J, K, L)
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &(C, D, E, F, G, H, I, J, K, L)
) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(C, D, E, F, G, H, I, J, K, L)) -> bool
fn lt(&self, other: &(C, D, E, F, G, H, I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(C, D, E, F, G, H, I, J, K, L)) -> bool
fn le(&self, other: &(C, D, E, F, G, H, I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(D, E, F, G, H, I, J, K, L)> for (D, E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(D, E, F, G, H, I, J, K, L)> for (D, E, F, G, H, I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(D, E, F, G, H, I, J, K, L)) -> Option<Ordering>
fn partial_cmp(&self, other: &(D, E, F, G, H, I, J, K, L)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(D, E, F, G, H, I, J, K, L)) -> bool
fn lt(&self, other: &(D, E, F, G, H, I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(D, E, F, G, H, I, J, K, L)) -> bool
fn le(&self, other: &(D, E, F, G, H, I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(E, F, G, H, I, J, K, L)> for (E, F, G, H, I, J, K, L) where
L: ?Sized,
impl<E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(E, F, G, H, I, J, K, L)> for (E, F, G, H, I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(E, F, G, H, I, J, K, L)) -> Option<Ordering>
fn partial_cmp(&self, other: &(E, F, G, H, I, J, K, L)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(E, F, G, H, I, J, K, L)) -> bool
fn lt(&self, other: &(E, F, G, H, I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(E, F, G, H, I, J, K, L)) -> bool
fn le(&self, other: &(E, F, G, H, I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(F, G, H, I, J, K, L)> for (F, G, H, I, J, K, L) where
L: ?Sized,
impl<F: PartialOrd + PartialEq, G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(F, G, H, I, J, K, L)> for (F, G, H, I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(F, G, H, I, J, K, L)) -> Option<Ordering>
fn partial_cmp(&self, other: &(F, G, H, I, J, K, L)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(F, G, H, I, J, K, L)) -> bool
fn lt(&self, other: &(F, G, H, I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(F, G, H, I, J, K, L)) -> bool
fn le(&self, other: &(F, G, H, I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(G, H, I, J, K, L)> for (G, H, I, J, K, L) where
L: ?Sized,
impl<G: PartialOrd + PartialEq, H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(G, H, I, J, K, L)> for (G, H, I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(G, H, I, J, K, L)) -> Option<Ordering>
fn partial_cmp(&self, other: &(G, H, I, J, K, L)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(G, H, I, J, K, L)) -> bool
fn lt(&self, other: &(G, H, I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(G, H, I, J, K, L)) -> bool
fn le(&self, other: &(G, H, I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(H, I, J, K, L)> for (H, I, J, K, L) where
L: ?Sized,
impl<H: PartialOrd + PartialEq, I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(H, I, J, K, L)> for (H, I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(H, I, J, K, L)) -> Option<Ordering>
fn partial_cmp(&self, other: &(H, I, J, K, L)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(H, I, J, K, L)) -> bool
fn lt(&self, other: &(H, I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(H, I, J, K, L)) -> bool
fn le(&self, other: &(H, I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(I, J, K, L)> for (I, J, K, L) where
L: ?Sized,
impl<I: PartialOrd + PartialEq, J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(I, J, K, L)> for (I, J, K, L) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(I, J, K, L)) -> Option<Ordering>
fn partial_cmp(&self, other: &(I, J, K, L)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(I, J, K, L)) -> bool
fn lt(&self, other: &(I, J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(I, J, K, L)) -> bool
fn le(&self, other: &(I, J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(J, K, L)> for (J, K, L) where
L: ?Sized,
impl<J: PartialOrd + PartialEq, K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(J, K, L)> for (J, K, L) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(J, K, L)) -> Option<Ordering>
fn partial_cmp(&self, other: &(J, K, L)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(J, K, L)) -> bool
fn lt(&self, other: &(J, K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(J, K, L)) -> bool
fn le(&self, other: &(J, K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(K, L)> for (K, L) where
L: ?Sized,
impl<K: PartialOrd + PartialEq, L: PartialOrd + PartialEq> PartialOrd<(K, L)> for (K, L) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(K, L)) -> Option<Ordering>
fn partial_cmp(&self, other: &(K, L)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(K, L)) -> bool
fn lt(&self, other: &(K, L)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(K, L)) -> bool
fn le(&self, other: &(K, L)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<L: PartialOrd + PartialEq> PartialOrd<(L,)> for (L,) where
L: ?Sized,
impl<L: PartialOrd + PartialEq> PartialOrd<(L,)> for (L,) where
L: ?Sized,
sourcefn partial_cmp(&self, other: &(L,)) -> Option<Ordering>
fn partial_cmp(&self, other: &(L,)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(L,)) -> bool
fn lt(&self, other: &(L,)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(L,)) -> bool
fn le(&self, other: &(L,)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
1.53.0 · sourceimpl<T> SliceIndex<[T]> for (Bound<usize>, Bound<usize>)
impl<T> SliceIndex<[T]> for (Bound<usize>, Bound<usize>)
sourcefn get(self, slice: &[T]) -> Option<&Self::Output>
fn get(self, slice: &[T]) -> Option<&Self::Output>
slice_index_methods
)Returns a shared reference to the output at this location, if in bounds. Read more
sourcefn get_mut(self, slice: &mut [T]) -> Option<&mut Self::Output>
fn get_mut(self, slice: &mut [T]) -> Option<&mut Self::Output>
slice_index_methods
)Returns a mutable reference to the output at this location, if in bounds. Read more
sourceunsafe fn get_unchecked(self, slice: *const [T]) -> *const Self::Output
unsafe fn get_unchecked(self, slice: *const [T]) -> *const Self::Output
slice_index_methods
)Returns a shared reference to the output at this location, without
performing any bounds checking.
Calling this method with an out-of-bounds index or a dangling slice
pointer
is undefined behavior even if the resulting reference is not used. Read more
sourceunsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut Self::Output
unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut Self::Output
slice_index_methods
)Returns a mutable reference to the output at this location, without
performing any bounds checking.
Calling this method with an out-of-bounds index or a dangling slice
pointer
is undefined behavior even if the resulting reference is not used. Read more