Skip to main content

FixedSize

Trait FixedSize 

pub trait FixedSize {
    const SIZE: usize;
}
Expand description

The number of octets occupied by a value in the encoded representation.

This is independent of Rust’s memory layout. Implementations must describe a constant encoded size; optional and variable-length values do not qualify.

Required Associated Constants§

const SIZE: usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl FixedSize for f32

§

const SIZE: usize = 4

§

impl FixedSize for f64

§

const SIZE: usize = 8

§

impl FixedSize for i8

§

const SIZE: usize = 1

§

impl FixedSize for i16

§

const SIZE: usize = 2

§

impl FixedSize for i32

§

const SIZE: usize = 4

§

impl FixedSize for i64

§

const SIZE: usize = 8

§

impl FixedSize for u8

§

const SIZE: usize = 1

§

impl FixedSize for u16

§

const SIZE: usize = 2

§

impl FixedSize for u32

§

const SIZE: usize = 4

§

impl FixedSize for u64

§

const SIZE: usize = 8

§

impl<const N: usize> FixedSize for [u8; N]

§

const SIZE: usize = N

Implementors§