Struct CNil
pub struct CNil<T>(/* private fields */)
where
T: CStackListHeadLimit;Expand description
Empty repr(C) list used as the tail sentinel for CStackList.
The hidden backing tail preserves prefix-view layout but contributes no
logical fields. Construct an owning empty root through EmptyList::root_empty.
§Examples
use cel_runtime::{CNil, EmptyList, IntoCStackList, IntoRustTuple, List};
let empty = CNil::<()>::root_empty();
assert!(empty.is_empty());
assert_eq!(empty.push_first("first").into_rust_tuple(), ("first",));
assert_eq!(().into_c_stack_list().len(), 0);Trait Implementations§
§impl<T> CStackListHeadLimit for CNil<T>where
T: CStackListHeadLimit,
impl<T> CStackListHeadLimit for CNil<T>where
T: CStackListHeadLimit,
§const HEAD_LIMIT: usize = T::HEAD_LIMIT
const HEAD_LIMIT: usize = T::HEAD_LIMIT
§impl<T> Clone for CNil<T>where
T: Clone + CStackListHeadLimit,
impl<T> Clone for CNil<T>where
T: Clone + CStackListHeadLimit,
§impl<T> Debug for CNil<T>where
T: CStackListHeadLimit,
impl<T> Debug for CNil<T>where
T: CStackListHeadLimit,
§impl<T> EmptyList for CNil<T>where
T: CStackListHeadLimit,
impl<T> EmptyList for CNil<T>where
T: CStackListHeadLimit,
§fn push_first<U>(self, item: U) -> <CNil<T> as EmptyList>::PushFirst<U>where
U: 'static,
fn push_first<U>(self, item: U) -> <CNil<T> as EmptyList>::PushFirst<U>where
U: 'static,
Moves a first field into a node backed by this empty sentinel.
§fn root_empty() -> <CNil<T> as EmptyList>::RootEmpty
fn root_empty() -> <CNil<T> as EmptyList>::RootEmpty
Constructs the empty canonical root without backing fields.
§type PushFirst<U: 'static> = CStackList<U, CNil<T>>
type PushFirst<U: 'static> = CStackList<U, CNil<T>>
§impl IntoRustTuple for CNil<()>
impl IntoRustTuple for CNil<()>
§fn into_rust_tuple(self) -> <CNil<()> as IntoRustTuple>::Tuple
fn into_rust_tuple(self) -> <CNil<()> as IntoRustTuple>::Tuple
Consumes the canonical empty list and returns the empty tuple.
§impl<T, P> ListTypeIteratorAdvance<P> for CNil<T>where
T: CStackListHeadLimit,
P: ListTypeProperty,
impl<T, P> ListTypeIteratorAdvance<P> for CNil<T>where
T: CStackListHeadLimit,
P: ListTypeProperty,
§fn advancer<R>(
_iter: &mut ListTypeIterator<R, P>,
) -> Option<<P as ListTypeProperty>::Output>where
R: List,
fn advancer<R>(
_iter: &mut ListTypeIterator<R, P>,
) -> Option<<P as ListTypeProperty>::Output>where
R: List,
Reports exhaustion without generating a property for the backing tail.
§impl StackResult for CNil<()>
impl StackResult for CNil<()>
§unsafe fn take_result(_stack: &mut RawStack) -> Undefined
unsafe fn take_result(_stack: &mut RawStack) -> Undefined
Returns the empty-stack marker without reading a nonexistent slot.
§impl ToTypeIdList for CNil<()>
impl ToTypeIdList for CNil<()>
§fn to_stack_info_list() -> Vec<StackInfo>
fn to_stack_info_list() -> Vec<StackInfo>
Returns an empty preloaded stack.
Auto Trait Implementations§
impl<T> Freeze for CNil<T>where
T: Freeze,
impl<T> RefUnwindSafe for CNil<T>where
T: RefUnwindSafe,
impl<T> Send for CNil<T>where
T: Send,
impl<T> Sync for CNil<T>where
T: Sync,
impl<T> Unpin for CNil<T>where
T: Unpin,
impl<T> UnsafeUnpin for CNil<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CNil<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> List for Twhere
T: EmptyList,
impl<T> List for Twhere
T: EmptyList,
§fn tail(&self) -> &<T as List>::Tail
fn tail(&self) -> &<T as List>::Tail
Borrows the remaining logical fields.
- Precondition: The list is nonempty.
§fn push<U>(self, item: U) -> <T as List>::Push<U>
fn push<U>(self, item: U) -> <T as List>::Push<U>
Moves the first logical field into this empty list.
§fn append<U>(self, other: U) -> <T as List>::Append<U>where
U: List,
fn append<U>(self, other: U) -> <T as List>::Append<U>where
U: List,
Returns other because this list contributes no logical fields.
§fn reverse_onto<U>(self, other: U) -> <T as List>::ReverseOnto<U>where
U: List,
fn reverse_onto<U>(self, other: U) -> <T as List>::ReverseOnto<U>where
U: List,
Returns other because reversing the empty list adds no fields.
§type Empty = <T as EmptyList>::RootEmpty
type Empty = <T as EmptyList>::RootEmpty
List::empty().§type Push<U: 'static> = <T as EmptyList>::PushFirst<U>
type Push<U: 'static> = <T as EmptyList>::PushFirst<U>
§type ReverseOnto<U: List> = U
type ReverseOnto<U: List> = U
Self onto U.