pub trait MaxSize {
const POSTCARD_MAX_SIZE: usize;
}
Available on crate feature
experimental-derive
only.Expand description
This trait is used to enforce the maximum size required to store the serialization of a given type.
Required Associated Constants§
Sourceconst POSTCARD_MAX_SIZE: usize
const POSTCARD_MAX_SIZE: usize
The maximum possible size that the serialization of this type can have, in bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl MaxSize for NonZeroI16
impl MaxSize for NonZeroI16
const POSTCARD_MAX_SIZE: usize = 3usize
Source§impl MaxSize for NonZeroI32
impl MaxSize for NonZeroI32
const POSTCARD_MAX_SIZE: usize = 5usize
Source§impl MaxSize for NonZeroI64
impl MaxSize for NonZeroI64
const POSTCARD_MAX_SIZE: usize = 10usize
Source§impl MaxSize for NonZeroI128
impl MaxSize for NonZeroI128
const POSTCARD_MAX_SIZE: usize = 19usize
Source§impl MaxSize for NonZeroIsize
impl MaxSize for NonZeroIsize
const POSTCARD_MAX_SIZE: usize = 10usize
Source§impl MaxSize for NonZeroU16
impl MaxSize for NonZeroU16
const POSTCARD_MAX_SIZE: usize = 3usize
Source§impl MaxSize for NonZeroU32
impl MaxSize for NonZeroU32
const POSTCARD_MAX_SIZE: usize = 5usize
Source§impl MaxSize for NonZeroU64
impl MaxSize for NonZeroU64
const POSTCARD_MAX_SIZE: usize = 10usize
Source§impl MaxSize for NonZeroU128
impl MaxSize for NonZeroU128
const POSTCARD_MAX_SIZE: usize = 19usize
Source§impl MaxSize for NonZeroUsize
impl MaxSize for NonZeroUsize
const POSTCARD_MAX_SIZE: usize = 10usize
Source§impl<A: MaxSize> MaxSize for (A,)
impl<A: MaxSize> MaxSize for (A,)
const POSTCARD_MAX_SIZE: usize = A::POSTCARD_MAX_SIZE
Source§impl<A: MaxSize, B: MaxSize, C: MaxSize> MaxSize for (A, B, C)
impl<A: MaxSize, B: MaxSize, C: MaxSize> MaxSize for (A, B, C)
const POSTCARD_MAX_SIZE: usize = _
Source§impl<A: MaxSize, B: MaxSize, C: MaxSize, D: MaxSize> MaxSize for (A, B, C, D)
impl<A: MaxSize, B: MaxSize, C: MaxSize, D: MaxSize> MaxSize for (A, B, C, D)
const POSTCARD_MAX_SIZE: usize = _
Source§impl<A: MaxSize, B: MaxSize, C: MaxSize, D: MaxSize, E: MaxSize> MaxSize for (A, B, C, D, E)
impl<A: MaxSize, B: MaxSize, C: MaxSize, D: MaxSize, E: MaxSize> MaxSize for (A, B, C, D, E)
const POSTCARD_MAX_SIZE: usize = _
Source§impl<A: MaxSize, B: MaxSize, C: MaxSize, D: MaxSize, E: MaxSize, F: MaxSize> MaxSize for (A, B, C, D, E, F)
impl<A: MaxSize, B: MaxSize, C: MaxSize, D: MaxSize, E: MaxSize, F: MaxSize> MaxSize for (A, B, C, D, E, F)
const POSTCARD_MAX_SIZE: usize = _
Source§impl<T> MaxSize for PhantomData<T>
impl<T> MaxSize for PhantomData<T>
const POSTCARD_MAX_SIZE: usize = 0usize
Source§impl<T: MaxSize> MaxSize for &mut T
impl<T: MaxSize> MaxSize for &mut T
const POSTCARD_MAX_SIZE: usize = T::POSTCARD_MAX_SIZE
Source§impl<T: MaxSize> MaxSize for Box<T>
Available on crate feature alloc
only.
impl<T: MaxSize> MaxSize for Box<T>
Available on crate feature
alloc
only.const POSTCARD_MAX_SIZE: usize = T::POSTCARD_MAX_SIZE
Source§impl<T: MaxSize> MaxSize for Rc<T>
Available on crate feature alloc
only.
impl<T: MaxSize> MaxSize for Rc<T>
Available on crate feature
alloc
only.const POSTCARD_MAX_SIZE: usize = T::POSTCARD_MAX_SIZE
Source§impl<T: MaxSize> MaxSize for Arc<T>
Available on crate feature alloc
and target_has_atomic="ptr"
only.
impl<T: MaxSize> MaxSize for Arc<T>
Available on crate feature
alloc
and target_has_atomic="ptr"
only.const POSTCARD_MAX_SIZE: usize = T::POSTCARD_MAX_SIZE
Source§impl<T: MaxSize, E: MaxSize> MaxSize for Result<T, E>
impl<T: MaxSize, E: MaxSize> MaxSize for Result<T, E>
const POSTCARD_MAX_SIZE: usize = _
Source§impl<T: MaxSize, const N: usize> MaxSize for Vec<T, N>
Available on crate feature heapless
only.
impl<T: MaxSize, const N: usize> MaxSize for Vec<T, N>
Available on crate feature
heapless
only.const POSTCARD_MAX_SIZE: usize = _
Source§impl<const N: usize> MaxSize for String<N>
Available on crate feature heapless
only.
impl<const N: usize> MaxSize for String<N>
Available on crate feature
heapless
only.