xwt_anchor/impls/core/
deref.rs

1//! Derefs.
2
3use crate::types::*;
4
5/// Implement all traits for a given type.
6macro_rules! implement {
7    (
8        $($t:ty,)*
9    ) => {
10        $(
11            impl<T> core::ops::Deref for $t {
12                type Target = T;
13
14                fn deref(&self) -> &Self::Target {
15                    &self.0
16                }
17            }
18
19            impl<T> core::ops::DerefMut for $t {
20                fn deref_mut(&mut self) -> &mut Self::Target {
21                    &mut self.0
22                }
23            }
24        )*
25    };
26}
27
28crate::for_all_material_types!(implement);