Skip to main content

Module list_traits

Module list_traits 

Expand description

Traits for working with type lists and type information. Builds and borrows heterogeneous lists without erasing their field types.

use cel_runtime::{IntoTupleList, List, TypeIdIterator};
let list = (String::from("first"), 7u8).into_tuple_list();
assert_eq!(list.head(), "first");
assert_eq!(*list.tail().head(), 7);
assert_eq!(list.len(), 2);
assert!(!list.is_empty());
assert_eq!(list.reverse().reverse().append(()).len(), 2);
assert_eq!(TypeIdIterator::<(String, (u8, ()))>::default().count(), 2);

Structs§

ListTypeIterator
Iterator over type-level List values producing properties via P.
Undefined
Marker type representing the head of an empty list.

Traits§

EmptyList
Trait implemented by empty lists to support list construction.
IntoList
Moves source fields into a type-level List.
List
Represents a finite heterogeneous list with source-ordered heads and tails.
ListIndex
Indexing for lists using typenum-based indices and ranges.
ListTypeIteratorAdvance
Advance function provider used by ListTypeIterator.
ListTypeProperty
Property generator for iterating over type-level lists.
ToList
Converts to a type-level List without consuming the source.

Type Aliases§

Item
Names the field or sublist type selected by index N in list L.
ReverseList
Convenience alias for reversing a List onto its empty counterpart.
TypeIdIterator
Iterator that yields the TypeId of each head in the List.