Skip to main content

CStackListHeadLimit

Trait CStackListHeadLimit 

pub trait CStackListHeadLimit: Layout {
    const HEAD_LIMIT: usize;
}
Expand description

Describes the trusted head boundary of a canonical stack-list representation.

Only this crate defines layout metadata used by safe indexing and execution.

§Examples

use cel_runtime::{CStackList, CStackListHeadLimit, CNil};
assert_eq!(CStackList::<u32, CNil<()>>::HEAD_LIMIT, 4);

Foreign types cannot supply unchecked representation metadata:

ⓘ
use cel_runtime::CStackListHeadLimit;
struct Foreign;
impl CStackListHeadLimit for Foreign {
    const HEAD_LIMIT: usize = 0;
}

Required Associated Constants§

const HEAD_LIMIT: usize

The offset to the end of the head element.

§Examples

See the CStackListHeadLimit example.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

§

impl CStackListHeadLimit for ()

§

const HEAD_LIMIT: usize = 0

Implementors§

§

impl<H, T> CStackListHeadLimit for CStackList<H, T>
where H: 'static, T: CStackListHeadLimit,

§

impl<T> CStackListHeadLimit for CNil<T>

§

const HEAD_LIMIT: usize = T::HEAD_LIMIT