cv_convert/
traits.rs

1pub use as_ref_cv::*;
2pub use to::*;
3pub use try_as_ref_cv::*;
4pub use try_to::*;
5
6mod try_to {
7    /// Fallible type conversion that is analogous to [TryInto](std::convert::TryInto).
8    pub trait TryToCv<T> {
9        type Error;
10
11        fn try_to_cv(&self) -> Result<T, Self::Error>;
12    }
13}
14
15mod to {
16    /// Type conversion that is analogous to [Into](std::convert::Into).
17    pub trait ToCv<T> {
18        fn to_cv(&self) -> T;
19    }
20}
21
22mod as_ref_cv {
23    pub trait AsRefCv<'a, T>
24    where
25        T: 'a,
26    {
27        fn as_ref_cv(&'a self) -> T;
28    }
29}
30
31mod try_as_ref_cv {
32    pub trait TryAsRefCv<'a, T>
33    where
34        T: 'a,
35    {
36        type Error;
37
38        fn try_as_ref_cv(&'a self) -> Result<T, Self::Error>;
39    }
40}