Skip to main content

CStackList

Struct CStackList 

Source
#[repr(C)]
pub struct CStackList<H, T>(pub T, pub H) where T: CStackListHeadLimit;
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.

Tuple Fields§

§0: T§1: H

Trait Implementations§

Source§

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

Source§

const HEAD_LIMIT: usize

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

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

Source§

const HEAD_PADDED: bool

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

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

Source§

fn clone(&self) -> CStackList<H, T>

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: 'static + Debug, T: List + CStackListHeadLimit + DebugHelper,

Source§

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

Formats the value using the given formatter. Read more
Source§

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

Source§

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

The returned type after indexing.
Source§

fn index(&self, index: Idx) -> &<CStackList<H, T> as Index<Idx>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

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

Source§

type Tuple = (A,)

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

fn into_rust_tuple(self) -> <CStackList<A, CNil<()>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

type Tuple = (A, B)

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CNil<()>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

type Tuple = (A, B, C)

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CNil<()>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

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

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CStackList<D, CNil<()>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

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

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CNil<()>>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

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

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CNil<()>>>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

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

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CNil<()>>>>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

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

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CNil<()>>>>>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

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

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CNil<()>>>>>>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

Source§

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

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

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CStackList<J, CNil<()>>>>>>>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

impl<A, B, C, D, E, F, G, H, I, J, K> 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<()>>>>>>>>>>>>
where A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static,

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§

fn into_rust_tuple( self, ) -> <CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CStackList<J, CStackList<K, CNil<()>>>>>>>>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> 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<()>>>>>>>>>>>>>
where A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static, L: 'static,

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§

fn into_rust_tuple( self, ) -> <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<()>>>>>>>>>>>>> as IntoRustTuple>::Tuple

Moves each logical field into the corresponding native tuple field. Read more
Source§

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

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 empty() -> <CStackList<H, T> as List>::Empty

Returns a new empty list that can be used to create a list with the same characteristics.
Source§

fn head(&self) -> &<CStackList<H, T> as List>::Head

Returns a reference to the head.
Source§

fn tail(&self) -> &<CStackList<H, T> as List>::Tail

Returns a reference to the rest of the list.
Source§

fn push<U>(self, item: U) -> <CStackList<H, T> as List>::Push<U>
where U: 'static,

Pushes a new value onto the front of the list, returning a new list.
Source§

fn append<U>(self, other: U) -> <CStackList<H, T> as List>::Append<U>
where U: List,

Append U as the tail of Self. Read more
Source§

fn reverse_onto<U>(self, other: U) -> <CStackList<H, T> as List>::ReverseOnto<U>
where U: List,

Reverse Self and append the result to other.
Source§

fn is_empty(&self) -> bool

Returns true if the list is empty.
Source§

const LENGTH: usize = _

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

fn len(&self) -> usize

Returns the length of the list.
Source§

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

Reverse this list, returning a new list with elements in opposite order.
Source§

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

Source§

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

The output reference type when indexing with Idx.
Source§

fn index( &self, index: RangeFrom<UInt<U, B>>, ) -> &<CStackList<H, T> as ListIndex<RangeFrom<UInt<U, B>>>>::Output

Return a reference to the element or sublist selected by index.
Source§

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

Source§

type Output = CStackList<H, T>

The output reference type when indexing with Idx.
Source§

fn index( &self, _index: RangeFrom<UTerm>, ) -> &<CStackList<H, T> as ListIndex<RangeFrom<UTerm>>>::Output

Return a reference to the element or sublist selected by index.
Source§

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

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§

fn index( &self, _index: RangeTo<UInt<U, B>>, ) -> &<CStackList<H, T> as ListIndex<RangeTo<UInt<U, B>>>>::Output

Return a reference to the element or sublist selected by index.
Source§

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

Source§

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

The output reference type when indexing with Idx.
Source§

fn index( &self, _index: RangeTo<UTerm>, ) -> &<CStackList<H, T> as ListIndex<RangeTo<UTerm>>>::Output

Return a reference to the element or sublist selected by index.
Source§

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

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§

fn index( &self, _index: RangeToInclusive<UInt<U, B>>, ) -> &<CStackList<H, T> as ListIndex<RangeToInclusive<UInt<U, B>>>>::Output

Return a reference to the element or sublist selected by index.
Source§

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

Source§

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

The output reference type when indexing with Idx.
Source§

fn index( &self, _index: RangeToInclusive<UTerm>, ) -> &<CStackList<H, T> as ListIndex<RangeToInclusive<UTerm>>>::Output

Return a reference to the element or sublist selected by index.
Source§

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

Source§

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

The output reference type when indexing with Idx.
Source§

fn index( &self, index: UInt<U, B>, ) -> &<CStackList<H, T> as ListIndex<UInt<U, B>>>::Output

Return a reference to the element or sublist selected by index.
Source§

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

Source§

type Output = H

The output reference type when indexing with Idx.
Source§

fn index( &self, _index: UTerm, ) -> &<CStackList<H, T> as ListIndex<UTerm>>::Output

Return a reference to the element or sublist selected by index.
Source§

impl<P, H, T> ListTypeIteratorAdvance<P> for CStackList<H, T>

Source§

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

Advance the iterator, returning the next property value.
Source§

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

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

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

Source§

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

Transfers the concrete head out of its owned stack slot.

Source§

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

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.