pub trait TupleRef {
type Ref<'a>
where Self: 'a;
// Required method
fn tuple_ref(&self) -> Self::Ref<'_>;
}Expand description
A trait for tuples that provides a method to get a tuple of references.
This trait provides both an associated type Ref<'a> that represents a tuple
of references to the elements, and a method tuple_ref that returns such a tuple.
§Examples
use tuplities_ref::TupleRef;
let tuple = (1, "hello".to_string(), vec![1, 2, 3]);
let refs = tuple.tuple_ref();
assert_eq!(refs, (&1, &"hello".to_string(), &vec![1, 2, 3]));Part of the tuplities crate.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.