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<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default> Default for (A, B, C, D, E, F, G, H, I, J, K)
impl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default, K: Default> Default for (A, B, C, D, E, F, G, H, I, J, K)
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<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default> Default for (A, B, C, D, E, F)
impl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default> Default for (A, B, C, D, E, F)
sourceimpl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default> Default for (A, B, C, D, E, F, G)
impl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default> Default for (A, B, C, D, E, F, G)
sourceimpl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default> Default for (A, B, C, D, E, F, G, H)
impl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default> Default for (A, B, C, D, E, F, G, H)
sourceimpl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default> Default for (A, B, C, D, E, F, G, H, I)
impl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default> Default for (A, B, C, D, E, F, G, H, I)
sourceimpl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default> Default for (A, B, C, D, E, F, G, H, I, J)
impl<A: Default, B: Default, C: Default, D: Default, E: Default, F: Default, G: Default, H: Default, I: Default, J: Default> Default for (A, B, C, D, E, F, G, H, I, J)
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<A: Ord> Ord for (A,) where
A: ?Sized,
impl<A: Ord> Ord for (A,) where
A: ?Sized,
sourceimpl<A: Ord, B: Ord> Ord for (A, B) where
B: ?Sized,
impl<A: Ord, B: Ord> Ord for (A, B) where
B: ?Sized,
sourceimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord> Ord for (A, B, C, D, E, F, G, H, I, J, K) where
K: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord> Ord for (A, B, C, D, E, F, G, H, I, J, K) where
K: ?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<A: Ord, B: Ord, C: Ord> Ord for (A, B, C) where
C: ?Sized,
impl<A: Ord, B: Ord, C: Ord> Ord for (A, B, C) where
C: ?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> Ord for (A, B, C, D) where
D: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord> Ord for (A, B, C, D) where
D: ?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> Ord for (A, B, C, D, E) where
E: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord> Ord for (A, B, C, D, E) where
E: ?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> Ord for (A, B, C, D, E, F) where
F: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord> Ord for (A, B, C, D, E, F) where
F: ?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> Ord for (A, B, C, D, E, F, G) where
G: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord> Ord for (A, B, C, D, E, F, G) where
G: ?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> Ord for (A, B, C, D, E, F, G, H) where
H: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord> Ord for (A, B, C, D, E, F, G, H) where
H: ?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> Ord for (A, B, C, D, E, F, G, H, I) where
I: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord> Ord for (A, B, C, D, E, F, G, H, I) where
I: ?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> Ord for (A, B, C, D, E, F, G, H, I, J) where
J: ?Sized,
impl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord> Ord for (A, B, C, D, E, F, G, H, I, J) where
J: ?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<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq> PartialEq<(A, B, C, D, E, F, G, H, I, J, K)> for (A, B, C, D, E, F, G, H, I, J, K) where
K: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq> PartialEq<(A, B, C, D, E, F, G, H, I, J, K)> for (A, B, C, D, E, F, G, H, I, J, K) where
K: ?Sized,
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq> PartialEq<(A, B, C, D, E, F, G, H, I, J)> for (A, B, C, D, E, F, G, H, I, J) where
J: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq> PartialEq<(A, B, C, D, E, F, G, H, I, J)> for (A, B, C, D, E, F, G, H, I, J) where
J: ?Sized,
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq> PartialEq<(A, B, C, D, E, F, G, H, I)> for (A, B, C, D, E, F, G, H, I) where
I: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq> PartialEq<(A, B, C, D, E, F, G, H, I)> for (A, B, C, D, E, F, G, H, I) where
I: ?Sized,
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq> PartialEq<(A, B, C, D, E, F, G, H)> for (A, B, C, D, E, F, G, H) where
H: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq> PartialEq<(A, B, C, D, E, F, G, H)> for (A, B, C, D, E, F, G, H) where
H: ?Sized,
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq> PartialEq<(A, B, C, D, E, F, G)> for (A, B, C, D, E, F, G) where
G: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq> PartialEq<(A, B, C, D, E, F, G)> for (A, B, C, D, E, F, G) where
G: ?Sized,
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq> PartialEq<(A, B, C, D, E, F)> for (A, B, C, D, E, F) where
F: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq> PartialEq<(A, B, C, D, E, F)> for (A, B, C, D, E, F) where
F: ?Sized,
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq> PartialEq<(A, B, C, D, E)> for (A, B, C, D, E) where
E: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq> PartialEq<(A, B, C, D, E)> for (A, B, C, D, E) where
E: ?Sized,
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq> PartialEq<(A, B, C, D)> for (A, B, C, D) where
D: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq> PartialEq<(A, B, C, D)> for (A, B, C, D) where
D: ?Sized,
sourceimpl<A: PartialEq, B: PartialEq, C: PartialEq> PartialEq<(A, B, C)> for (A, B, C) where
C: ?Sized,
impl<A: PartialEq, B: PartialEq, C: PartialEq> PartialEq<(A, B, C)> for (A, B, C) where
C: ?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<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> PartialOrd<(A, B, C, D, E, F, G, H, I, J, K)> for (A, B, C, D, E, F, G, H, I, J, K) where
K: ?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> PartialOrd<(A, B, C, D, E, F, G, H, I, J, K)> for (A, B, C, D, E, F, G, H, I, J, K) where
K: ?Sized,
sourcefn partial_cmp(
&self,
other: &(A, B, C, D, E, F, G, H, I, J, K)
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &(A, B, C, D, E, F, G, H, I, J, K)
) -> 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)) -> bool
fn lt(&self, other: &(A, B, C, D, E, F, G, H, I, J, K)) -> 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)) -> bool
fn le(&self, other: &(A, B, C, D, E, F, G, H, I, J, K)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
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> PartialOrd<(A, B, C, D, E, F, G, H, I, J)> for (A, B, C, D, E, F, G, H, I, J) where
J: ?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> PartialOrd<(A, B, C, D, E, F, G, H, I, J)> for (A, B, C, D, E, F, G, H, I, J) where
J: ?Sized,
sourcefn partial_cmp(
&self,
other: &(A, B, C, D, E, F, G, H, I, J)
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &(A, B, C, D, E, F, G, H, I, J)
) -> 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)) -> bool
fn lt(&self, other: &(A, B, C, D, E, F, G, H, I, J)) -> 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)) -> bool
fn le(&self, other: &(A, B, C, D, E, F, G, H, I, J)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
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> PartialOrd<(A, B, C, D, E, F, G, H, I)> for (A, B, C, D, E, F, G, H, I) where
I: ?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> PartialOrd<(A, B, C, D, E, F, G, H, I)> for (A, B, C, D, E, F, G, H, I) where
I: ?Sized,
sourcefn partial_cmp(&self, other: &(A, B, C, D, E, F, G, H, I)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A, B, C, D, E, F, G, H, I)) -> 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)) -> bool
fn lt(&self, other: &(A, B, C, D, E, F, G, H, I)) -> 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)) -> bool
fn le(&self, other: &(A, B, C, D, E, F, G, H, I)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
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> PartialOrd<(A, B, C, D, E, F, G, H)> for (A, B, C, D, E, F, G, H) where
H: ?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> PartialOrd<(A, B, C, D, E, F, G, H)> for (A, B, C, D, E, F, G, H) where
H: ?Sized,
sourcefn partial_cmp(&self, other: &(A, B, C, D, E, F, G, H)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A, B, C, D, E, F, G, H)) -> 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)) -> bool
fn lt(&self, other: &(A, B, C, D, E, F, G, H)) -> 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)) -> bool
fn le(&self, other: &(A, B, C, D, E, F, G, H)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq> PartialOrd<(A, B, C, D, E, F, G)> for (A, B, C, D, E, F, G) where
G: ?Sized,
impl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq, G: PartialOrd + PartialEq> PartialOrd<(A, B, C, D, E, F, G)> for (A, B, C, D, E, F, G) where
G: ?Sized,
sourcefn partial_cmp(&self, other: &(A, B, C, D, E, F, G)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A, B, C, D, E, F, G)) -> 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)) -> bool
fn lt(&self, other: &(A, B, C, D, E, F, G)) -> 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)) -> bool
fn le(&self, other: &(A, B, C, D, E, F, G)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq> PartialOrd<(A, B, C, D, E, F)> for (A, B, C, D, E, F) where
F: ?Sized,
impl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq, F: PartialOrd + PartialEq> PartialOrd<(A, B, C, D, E, F)> for (A, B, C, D, E, F) where
F: ?Sized,
sourcefn partial_cmp(&self, other: &(A, B, C, D, E, F)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A, B, C, D, E, F)) -> 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)) -> bool
fn lt(&self, other: &(A, B, C, D, E, F)) -> 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)) -> bool
fn le(&self, other: &(A, B, C, D, E, F)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq> PartialOrd<(A, B, C, D, E)> for (A, B, C, D, E) where
E: ?Sized,
impl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq, E: PartialOrd + PartialEq> PartialOrd<(A, B, C, D, E)> for (A, B, C, D, E) where
E: ?Sized,
sourcefn partial_cmp(&self, other: &(A, B, C, D, E)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A, B, C, D, E)) -> 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)) -> bool
fn lt(&self, other: &(A, B, C, D, E)) -> 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)) -> bool
fn le(&self, other: &(A, B, C, D, E)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq> PartialOrd<(A, B, C, D)> for (A, B, C, D) where
D: ?Sized,
impl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq, D: PartialOrd + PartialEq> PartialOrd<(A, B, C, D)> for (A, B, C, D) where
D: ?Sized,
sourcefn partial_cmp(&self, other: &(A, B, C, D)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A, B, C, D)) -> 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)) -> bool
fn lt(&self, other: &(A, B, C, D)) -> 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)) -> bool
fn le(&self, other: &(A, B, C, D)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq> PartialOrd<(A, B, C)> for (A, B, C) where
C: ?Sized,
impl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq, C: PartialOrd + PartialEq> PartialOrd<(A, B, C)> for (A, B, C) where
C: ?Sized,
sourcefn partial_cmp(&self, other: &(A, B, C)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A, B, C)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(A, B, C)) -> bool
fn lt(&self, other: &(A, B, C)) -> 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)) -> bool
fn le(&self, other: &(A, B, C)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq> PartialOrd<(A, B)> for (A, B) where
B: ?Sized,
impl<A: PartialOrd + PartialEq, B: PartialOrd + PartialEq> PartialOrd<(A, B)> for (A, B) where
B: ?Sized,
sourcefn partial_cmp(&self, other: &(A, B)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A, B)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(A, B)) -> bool
fn lt(&self, other: &(A, B)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(A, B)) -> bool
fn le(&self, other: &(A, B)) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<A: PartialOrd + PartialEq> PartialOrd<(A,)> for (A,) where
A: ?Sized,
impl<A: PartialOrd + PartialEq> PartialOrd<(A,)> for (A,) where
A: ?Sized,
sourcefn partial_cmp(&self, other: &(A,)) -> Option<Ordering>
fn partial_cmp(&self, other: &(A,)) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn lt(&self, other: &(A,)) -> bool
fn lt(&self, other: &(A,)) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcefn le(&self, other: &(A,)) -> bool
fn le(&self, other: &(A,)) -> 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