tuplities_copy/lib.rs
1#![no_std]
2
3//! [tuplities](https://github.com/lucacappelletti94/tuplities) suite crate providing the `TupleCopy` trait.
4
5use tuplities_clone::TupleClone;
6
7#[tuplities_derive::impl_tuple_copy]
8/// A trait for copying tuples.
9///
10/// Part of the [`tuplities`](https://docs.rs/tuplities/latest/tuplities/) crate.
11pub trait TupleCopy: TupleClone {
12 #[must_use]
13 /// Copies `self` into a new instance.
14 ///
15 /// # Examples
16 ///
17 /// ```rust
18 /// use tuplities_copy::TupleCopy;
19 ///
20 /// let tuple = (1, "hello", 3.14);
21 /// let copied_tuple = tuple.tuple_copy();
22 ///
23 /// assert_eq!(tuple, copied_tuple);
24 /// ```
25 fn tuple_copy(&self) -> Self;
26}