Skip to main content

Length

Trait Length 

Source
pub unsafe trait Length: Copy {
    // Required method
    fn value(self) -> usize;
}
Expand description

A trait allowing a type to yield a value.

This allows the lengths of BitSlices to be either static or dynamic.

§Safety

Implementations must ensure that self.value() always returns the same value for a given instance and that this value is preserved across all copies obtained from self.

Required Methods§

Source

fn value(self) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Length for Dynamic

Source§

impl<const N: usize> Length for Static<N>