FixedSized

Trait FixedSized 

Source
pub trait FixedSized: Copy + Sized {
    const SERIALIZED_SIZE: usize = _;
}
Expand description

A trait which should be given to any type which will always take up the same amount of space when serialized. This goes one step beyond the Sized trait which only requires it to take up a set amount of space on the stack. This is saying that the total data it contains and points to must always be of the exact same size for every instance.

Provided Associated Constants§

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 FixedSized for bool

Source§

impl FixedSized for char

Source§

impl FixedSized for f32

Source§

impl FixedSized for f64

Source§

impl FixedSized for i8

Source§

impl FixedSized for i16

Source§

impl FixedSized for i32

Source§

impl FixedSized for i64

Source§

impl FixedSized for i128

Source§

impl FixedSized for isize

Source§

impl FixedSized for u8

Source§

impl FixedSized for u16

Source§

impl FixedSized for u32

Source§

impl FixedSized for u64

Source§

impl FixedSized for u128

Source§

impl FixedSized for usize

Source§

impl<T: FixedSized, const S: usize> FixedSized for [T; S]

Implementors§