TrustedLayout

Trait TrustedLayout 

Source
pub unsafe trait TrustedLayout: Layout { }
Expand description

A layout which upholds guarantees on returned storage offsets.

§Safety

Layouts which implement this trait promise that any offsets returned by offset and offset_unchecked are less than the than the minimum required storage length reported by min_data_len. This promise means that the offsets can be used to access elements in a buffer without a bounds check.

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<L: TrustedLayout> TrustedLayout for &L

Implementors§