tuples/
tuple_as.rs

1//! As X
2
3use core::ops::{Deref, DerefMut};
4
5include!("./gen/tuple_as.rs");
6
7/// AsRef for Tuple
8pub trait TupleAsRef<'a> {
9    type OutTuple: 'a;
10
11    /// AsRef for Tuple
12    fn as_ref(&'a self) -> Self::OutTuple;
13}
14
15/// AsMut for Tuple
16pub trait TupleAsMut<'a> {
17    type OutTuple: 'a;
18
19    /// AsMut for Tuple
20    fn as_mut(&'a mut self) -> Self::OutTuple;
21}
22
23/// Mapping item to `Option` for Tuple
24pub trait TupleAsOption {
25    type OutTuple;
26
27    /// Mapping item to `Option::Some` for Tuple
28    fn as_some(self) -> Self::OutTuple;
29}
30
31/// Mapping item to `Result` for Tuple
32pub trait TupleAsResultOk<E> {
33    type OutTuple;
34
35    /// Mapping item to `Result::Ok` for Tuple
36    fn as_ok(self) -> Self::OutTuple;
37}
38
39/// Mapping item to `Result` for Tuple
40pub trait TupleAsResultErr<T> {
41    type OutTuple;
42
43    /// Mapping item to `Result::Err` for Tuple
44    fn as_err(self) -> Self::OutTuple;
45}
46
47/// AsDeref for Tuple
48pub trait TupleAsDeref<'a> {
49    type OutTuple: 'a;
50
51    /// AsDeref for Tuple
52    fn as_deref(&'a self) -> Self::OutTuple;
53}
54
55/// AsDerefMut for Tuple
56pub trait TupleAsDerefMut<'a> {
57    type OutTuple: 'a;
58
59    /// AsDerefMut for Tuple
60    fn as_deref_mut(&'a mut self) -> Self::OutTuple;
61}