utility_macros_internals/readonly.rs
1/// A trait for types that have a readonly version.
2pub trait HasReadonly {
3 /// The readonly version of the type.
4 type Readonly;
5
6 /// Converts the type to its readonly version.
7 fn readonly(&self) -> Self::Readonly;
8}
9
10/// A trait for readonly versions of types.
11pub trait Readonly {
12 /// The type that the readonly version is for.
13 type Type;
14
15 /// Converts the readonly version to the original type.
16 fn type_(&self) -> Self::Type;
17}