Skip to main content

CStackList

Struct CStackList 

Source
#[repr(C)]
pub struct CStackList<H, T: CStackListHeadLimit>(pub T, pub H);
Expand description

A list using a guaranteed memory layout (repr(C)), with tail stored first so appending items does not change the memory layout of prior items.

Cloning copies each field according to its Clone contract. Equality compares lengths and corresponding logical fields, independently of physical layout.

§Examples

use cel_runtime::IntoCStackList;
let list = (String::from("owned"), 7u8).into_c_stack_list();
assert_eq!(list, list.clone());

Tuple Fields§

§0: T§1: H

Trait Implementations§

Source§

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

Source§

const HEAD_LIMIT: usize

The offset to the end of the head element. Read more
Source§

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

Source§

const HEAD_PADDED: bool

Whether the head element is padded to the next alignment boundary. Read more
Source§

impl<H: Clone, T: Clone + CStackListHeadLimit> Clone for CStackList<H, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<H, T> Debug for CStackList<H, T>
where H: Debug + 'static, T: DebugHelper + List + CStackListHeadLimit,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the logical fields as a source-ordered tuple.

§Errors

Returns a destination or field formatting error.

  • Complexity: O(n) field formatting operations for n fields.
Source§

impl<H: 'static, T: List + CStackListHeadLimit, Idx> Index<Idx> for CStackList<H, T>
where Self: ListIndex<Idx>, <Self as ListIndex<Idx>>::Output: Sized,

Source§

fn index(&self, index: Idx) -> &Self::Output

Borrows the field or sublist selected by the underlying list index.

  • Complexity: The selected ListIndex operation’s complexity.
Source§

type Output = <CStackList<H, T> as ListIndex<Idx>>::Output

The returned type after indexing.
Source§

impl<A: 'static> IntoRustTuple for CStackList<A, CNil<()>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A,)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static> IntoRustTuple for CStackList<A, CStackList<B, CNil<()>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CNil<()>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CNil<()>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CNil<()>>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D, E)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CNil<()>>>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D, E, F)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CNil<()>>>>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D, E, F, G)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CNil<()>>>>>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D, E, F, G, H)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CNil<()>>>>>>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D, E, F, G, H, I)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CStackList<J, CNil<()>>>>>>>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D, E, F, G, H, I, J)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CStackList<J, CStackList<K, CNil<()>>>>>>>>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D, E, F, G, H, I, J, K)

The native tuple type with fields in logical source order.
Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static, L: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CStackList<J, CStackList<K, CStackList<L, CNil<()>>>>>>>>>>>>>

Source§

fn into_rust_tuple(self) -> Self::Tuple

Moves the canonical fields into their corresponding native tuple positions.

  • Complexity: O(n) field moves for n fields, without allocation.
Source§

type Tuple = (A, B, C, D, E, F, G, H, I, J, K, L)

The native tuple type with fields in logical source order.
Source§

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

Source§

fn empty() -> Self::Empty

Creates the canonical empty list without borrowing this list’s values.

Source§

fn head(&self) -> &Self::Head

Borrows the first logical field.

Source§

fn tail(&self) -> &Self::Tail

Borrows the remaining logical fields.

Source§

fn push<U: 'static>(self, item: U) -> Self::Push<U>

Moves a new first field and this list into their canonical node.

Source§

fn append<U: List>(self, other: U) -> Self::Append<U>

Moves these fields before other without cloning them.

  • Complexity: O(n) field moves for n fields in this list.
Source§

fn reverse_onto<U: List>(self, other: U) -> Self::ReverseOnto<U>

Moves these fields in reverse order before other.

  • Complexity: O(n) field moves for n fields in this list.
Source§

type Empty = CNil<()>

The type returned by List::empty().
Source§

type Head = H

The type of head.
Source§

type Tail = T

The type of the rest of the list.
Source§

type Push<U: 'static> = CStackList<U, CStackList<H, T>>

The type of the list after pushing a new value.
Source§

type Append<U: List> = <<T as List>::Append<U> as List>::Push<H>

The style of List appended to Self
Source§

type ReverseOnto<U: List> = <T as List>::ReverseOnto<<U as List>::Push<H>>

The resulting list when reversing Self onto U.
Source§

fn is_empty(&self) -> bool

Returns true if the list is empty. Read more
Source§

const LENGTH: usize = _

The length of the list, computed at compile time.
Source§

fn len(&self) -> usize

Returns the length of the list. Read more
Source§

fn reverse(self) -> Self::ReverseOnto<Self::Empty>
where Self: Sized,

Moves this list’s fields into opposite source order. Read more
Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<RangeFrom<UInt<U, B>>> for CStackList<H, T>
where T: ListIndex<RangeFrom<Sub1<UInt<U, B>>>> + List + CStackListHeadLimit, UInt<U, B>: Sub<B1>,

Source§

fn index(&self, index: RangeFrom<UInt<U, B>>) -> &Self::Output

Borrows the suffix at the type-checked source index.

  • Complexity: O(i) tail traversals for source index i.
Source§

type Output = <T as ListIndex<RangeFrom<<UInt<U, B> as Sub<B1>>::Output>>>::Output

The output reference type when indexing with Idx.
Source§

impl<H: 'static, T: List + CStackListHeadLimit> ListIndex<RangeFrom<UTerm>> for CStackList<H, T>

Source§

fn index(&self, _index: RangeFrom<U0>) -> &Self::Output

Borrows the complete suffix starting at zero.

Source§

type Output = CStackList<H, T>

The output reference type when indexing with Idx.
Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<RangeTo<UInt<U, B>>> for CStackList<H, T>
where T: ListIndex<RangeTo<Sub1<UInt<U, B>>>> + List + CStackListHeadLimit, <T as ListIndex<RangeTo<Sub1<UInt<U, B>>>>>::Output: List, UInt<U, B>: Sub<B1>,

Source§

fn index(&self, _index: RangeTo<UInt<U, B>>) -> &Self::Output

Borrows the type-checked exclusive prefix in place.

Source§

type Output = <<T as ListIndex<RangeTo<<UInt<U, B> as Sub<B1>>::Output>>>::Output as List>::Push<H>

The output reference type when indexing with Idx.
Source§

impl<H: 'static, T: List + CStackListHeadLimit> ListIndex<RangeTo<UTerm>> for CStackList<H, T>

Source§

fn index(&self, _index: RangeTo<U0>) -> &Self::Output

Borrows an empty prefix without transferring or dropping the backing fields.

Source§

type Output = CNil<CStackList<H, T>>

The output reference type when indexing with Idx.
Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<RangeToInclusive<UInt<U, B>>> for CStackList<H, T>

Source§

fn index(&self, _index: RangeToInclusive<UInt<U, B>>) -> &Self::Output

Borrows the type-checked inclusive prefix in place.

Source§

type Output = <<T as ListIndex<RangeToInclusive<<UInt<U, B> as Sub<B1>>::Output>>>::Output as List>::Push<H>

The output reference type when indexing with Idx.
Source§

impl<H: 'static, T: List + CStackListHeadLimit> ListIndex<RangeToInclusive<UTerm>> for CStackList<H, T>

Source§

fn index(&self, _index: RangeToInclusive<U0>) -> &Self::Output

Borrows the singleton prefix without moving the backing tail.

Source§

type Output = CStackList<H, CNil<T>>

The output reference type when indexing with Idx.
Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<UInt<U, B>> for CStackList<H, T>
where T: ListIndex<Sub1<UInt<U, B>>> + List + CStackListHeadLimit, UInt<U, B>: Sub<B1>,

Source§

fn index(&self, index: UInt<U, B>) -> &Self::Output

Borrows the field at the type-checked source index.

  • Complexity: O(i) tail traversals for source index i.
Source§

type Output = <T as ListIndex<<UInt<U, B> as Sub<B1>>::Output>>::Output

The output reference type when indexing with Idx.
Source§

impl<H: 'static, T: List + CStackListHeadLimit> ListIndex<UTerm> for CStackList<H, T>

Source§

fn index(&self, _index: U0) -> &Self::Output

Borrows the first logical field.

Source§

type Output = H

The output reference type when indexing with Idx.
Source§

impl<P: ListTypeProperty, H: 'static, T: ListTypeIteratorAdvance<P> + CStackListHeadLimit> ListTypeIteratorAdvance<P> for CStackList<H, T>

Source§

fn advancer<R: List>(iter: &mut ListTypeIterator<R, P>) -> Option<P::Output>

Generates this head’s property and advances the iterator to its tail.

  • Complexity: The property generator’s complexity.
Source§

impl<H, T, O: List> PartialEq<O> for CStackList<H, T>
where H: PartialEq<O::Head> + 'static, T: PartialEq<O::Tail> + List + CStackListHeadLimit,

Source§

fn eq(&self, other: &O) -> bool

Compares lengths and corresponding logical elements.

  • Complexity: O(n) field comparisons for n elements, excluding field costs.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<H: 'static, T: List + CStackListHeadLimit> StackResult for CStackList<H, T>

Source§

unsafe fn take_result(stack: &mut RawStack) -> H

Transfers the concrete head out of its owned stack slot.

Source§

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

Source§

fn to_stack_info_list() -> Vec<StackInfo>

Enumerates tail storage followed by the opaque head.

  • Complexity: O(n) slots for n list elements.

Auto Trait Implementations§

§

impl<H, T> Freeze for CStackList<H, T>
where T: Freeze, H: Freeze,

§

impl<H, T> RefUnwindSafe for CStackList<H, T>

§

impl<H, T> Send for CStackList<H, T>
where T: Send, H: Send,

§

impl<H, T> Sync for CStackList<H, T>
where T: Sync, H: Sync,

§

impl<H, T> Unpin for CStackList<H, T>
where T: Unpin, H: Unpin,

§

impl<H, T> UnsafeUnpin for CStackList<H, T>
where T: UnsafeUnpin, H: UnsafeUnpin,

§

impl<H, T> UnwindSafe for CStackList<H, T>
where T: UnwindSafe, H: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.