BoundedIndex

Trait BoundedIndex 

Source
pub trait BoundedIndex:
    AsPrimitive<usize>
    + Zeroable
    + Copy
    + Send
    + Sync
    + Debug
    + Sealed
    + 'static {
    type Length: From<Self> + AsPrimitive<usize> + Copy + Send + Sync + Debug + 'static;

    const MAX_LEN: usize;
    const MAX_LENGTH: Self::Length;
}
Expand description

A trait for unsigned integer types that can be used as indices.

Required Associated Constants§

Source

const MAX_LEN: usize

The maximum length supported by this index type.

Source

const MAX_LENGTH: Self::Length

The maximum length supported by this index type.

Required Associated Types§

Source

type Length: From<Self> + AsPrimitive<usize> + Copy + Send + Sync + Debug + 'static

The minimal integer type that can represent MAX_LEN.

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 BoundedIndex for u8

Source§

const MAX_LEN: usize = 256usize

Source§

const MAX_LENGTH: u16 = 256u16

Source§

type Length = u16

Source§

impl BoundedIndex for u16

Source§

const MAX_LEN: usize = 65_536usize

Source§

const MAX_LENGTH: u32 = 65_536u32

Source§

type Length = u32

Source§

impl BoundedIndex for u32

Source§

const MAX_LEN: usize = 4_294_967_295usize

Source§

const MAX_LENGTH: u32 = 4_294_967_295u32

Source§

type Length = u32

Implementors§