The tuple type.
Methods
Returns true
if the tuple has a length of 0.
Examples
let a = ;
assert!;
let a = ;
assert!;
Returns a reference to an element or subslice depending on the type of index.
- If given a position, returns a reference to the element at that position or
None
if out of bounds. - If given a range, returns the subslice corresponding to that range, or
None
if out of bounds.
Examples
let v = ;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Trait Implementations
Compare two values for equality.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Compare two values for inequality.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Compare two values.
Examples
use Ordering;
assert_eq!;
assert_eq!;
assert_eq!;
Tests less than (for self
and other
) and is used by the <
operator.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Tests less than or equal to (for self
and other
) and is used by the <=
operator.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Tests greater than (for self
and other
) and is used by the >
operator.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Tests greater than or equal to (for self
and other
) and is used by the >=
operator.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Compare two values.
Examples
use Ordering;
assert_eq!;
assert_eq!;
assert_eq!;
Return the minimum of two values.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Return the maximum of two values.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Clone the specified value
.
Examples
let a = 42;
let b = a;
let c = a.clone;
a += 1;
assert_eq!;
assert_eq!;
assert_eq!;
Protocols
for item in value
Construct an iterator over the tuple.
Examples
let tuple = ;
let out = ;
for v in tuple
assert_eq!;
if value == b
Perform a partial equality check with this tuple.
This can take any argument which can be converted into an iterator using [INTO_ITER
].
Examples
let tuple = ;
assert!;
assert!;
assert!;
if value == b
Perform a total equality check with this tuple.
Examples
use eq;
let tuple = ;
assert!;
assert!;
if value < b
Perform a partial comparison check with this tuple.
Examples
let tuple = ;
assert!;
assert!;
if value < b
Perform a total comparison check with this tuple.
Examples
use Ordering;
use cmp;
let tuple = ;
assert_eq!;
assert_eq!;
let $out = clone
Clone a tuple.
Examples
use hash;
let a = ;
let b = a;
let c = a.clone;
c.0 = 1;
assert_eq!;
assert_eq!;
let $out = hash
Calculate a hash for a tuple.
Examples
use hash;
assert_eq!;
// Note: this is not guaranteed to be true forever, but it's true right now.
assert_eq!;