1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ========================================== impl<AnyType: ?Sized> AutoTrait for AnyType {} pub trait AutoTrait { // usage: // <u8>::_size() // <Option<u32>>::_size() fn _size() -> usize where Self: Sized, { std::mem::size_of::<Self>() } }