Struct ::std::tuple::Tuple
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!;
Protocols
protocol into_iter
for item in value
Construct an iterator over the tuple.
Examples
let tuple = ;
let out = ;
for v in tuple
assert_eq!;
protocol partial_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!;
protocol eq
if value == b
Perform a total equality check with this tuple.
Examples
use eq;
let tuple = ;
assert!;
assert!;
protocol partial_cmp
if value < b
Perform a partial comparison check with this tuple.
Examples
let tuple = ;
assert!;
assert!;
protocol cmp
if value < b
Perform a total comparison check with this tuple.
Examples
use Ordering;
use cmp;
let tuple = ;
assert_eq!;
assert_eq!;
protocol hash
let output = 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!;