Implement functionality to calculate the maximum size of various types and data structures in Rust using a trait named MaxSize. This trait should have a method max_size() which returns the size of the type in bytes.
Requirements:
Define a trait MaxSize with the following method:
rust
trait MaxSize {
fn max_size() -> usize;
}
Implement the MaxSize trait for the following primitive types:
u8
u16
u32
u64
usize
i8
i16
i32
i64
isize
f32
f64
bool
Each type’s max_size() implementation should return the size in bytes using the std::mem::size_of function.
Implement the MaxSize trait for:
Option<T>: The maximum size should be the sum of the sizes of u8 and T where T is the inner type (using size_of::<T>()).
Fixed-size arrays: Allow the implementation for any array type <[T; N]> returning N * size_of::<T>().
Tuples: Allow the implementation for tuples of arbitrary size, calculating the total size as the sum of the sizes of all elements in the tuple.
Structs: Implement MaxSize for any struct, calculating the size as the sum of the sizes of all fields.
Enums: Implement MaxSize for enums, calculating the size based on the sizes of stored variants.
Use PhantomData in struct definitions to account for types that do not have a storage representation.
All trait implementations should be placed in the /app/ directory under a module named peek_poke.
After implementing the features according to the specifications above, all tests provided in the initial code should pass.