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.

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.
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.
Source§

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

Source§

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

Formats the value using the given formatter. Read more
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§

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

The returned type after indexing.
Source§

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

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

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

Source§

type Tuple = (A,)

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

fn into_rust_tuple(self) -> Self::Tuple

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

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

Source§

type Tuple = (A, B)

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

fn into_rust_tuple(self) -> Self::Tuple

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

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

Source§

type Tuple = (A, B, C)

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

fn into_rust_tuple(self) -> Self::Tuple

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

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

Source§

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

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

fn into_rust_tuple(self) -> Self::Tuple

Moves each logical field into the corresponding native tuple field. Read more
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§

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

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

fn into_rust_tuple(self) -> Self::Tuple

Moves each logical field into the corresponding native tuple field. Read more
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§

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

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

fn into_rust_tuple(self) -> Self::Tuple

Moves each logical field into the corresponding native tuple field. Read more
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§

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) -> Self::Tuple

Moves each logical field into the corresponding native tuple field. Read more
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§

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) -> Self::Tuple

Moves each logical field into the corresponding native tuple field. Read more
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§

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) -> Self::Tuple

Moves each logical field into the corresponding native tuple field. Read more
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§

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) -> Self::Tuple

Moves each logical field into the corresponding native tuple field. Read more
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§

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) -> Self::Tuple

Moves each logical field into the corresponding native tuple field. Read more
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§

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) -> Self::Tuple

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

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

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() -> Self::Empty

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

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

Returns a reference to the head.
Source§

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

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

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

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

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

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

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

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: '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§

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>>) -> &Self::Output

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

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

Source§

type Output = CStackList<H, T>

The output reference type when indexing with Idx.
Source§

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

Return a reference to the element or sublist selected by index.
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§

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>>) -> &Self::Output

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

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

Source§

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

The output reference type when indexing with Idx.
Source§

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

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

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

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>>) -> &Self::Output

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

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

Source§

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

The output reference type when indexing with Idx.
Source§

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

Return a reference to the element or sublist selected by index.
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§

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>) -> &Self::Output

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

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

Source§

type Output = H

The output reference type when indexing with Idx.
Source§

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

Return a reference to the element or sublist selected by index.
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>

Advance the iterator, returning the next property value.
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

Equality operator ==. Read more
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 = 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.