Cons

Struct Cons 

Source
pub struct Cons<T, U>(pub T, pub U);
Expand description

Prepends an element to the cons-list, somewhat equivalent to the array [T, ...U].

Tuple Fields§

§0: T§1: U

Implementations§

Source§

impl<T, U> Cons<T, U>

Source

pub(crate) fn project<'pin>( self: Pin<&'pin mut Self>, ) -> __ConsProjection<'pin, T, U>

Source

pub(crate) fn project_ref<'pin>( self: Pin<&'pin Self>, ) -> __ConsProjectionRef<'pin, T, U>

Trait Implementations§

Source§

impl<T, U> AccessCount for Cons<T, U>
where T: AccessKind, U: AccessCount,

Source§

fn writers(type_id: TypeId) -> usize

Returns how many writers for the given type exist in this list.
Source§

fn readers(type_id: TypeId) -> usize

Returns how many readers for the given type exist in this list (both exclusive and non-exclusive).
Source§

fn exclusive_readers(type_id: TypeId) -> usize

Returns how many exclusive readers for the given type exist in this list.
Source§

impl<'a, T, U> ActorList<'a> for Cons<T, U>
where T: Actor<'a, StoreRequest: TupleConsToCons>, U: ActorList<'a>, <<T as Actor<'a>>::StoreRequest as TupleConsToCons>::Cons: AccessCount,

Source§

type StoreRequests = Cons<<<T as Actor<'a>>::StoreRequest as TupleConsToCons>::Cons, <U as ActorList<'a>>::StoreRequests>

Actor::StoreRequest for the #[actor] generated types is a tuple-cons-list, for each actor in this list convert its store requests into our nominal cons-list.

This doesn’t work with manual Actor implementations that have non-tuple-cons-list StoreRequests.

Source§

type InitContexts = Cons<<T as Actor<'a>>::InitContext, <U as ActorList<'a>>::InitContexts>

For Actor::InitContext we just need to map directly to the associated type.

Source§

impl<T: Clone, U: Clone> Clone for Cons<T, U>

Source§

fn clone(&self) -> Cons<T, U>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<S> Datastore for Cons<Source, S>
where S: Slots,

Given a slot cons-list, combines it with a generational::Source to implement Datastore.

Source§

fn source(self: Pin<&Self>) -> Pin<&Source>

Returns a generational source tracking the global datastore generation. Read more
Source§

fn slot<T>(self: Pin<&Self>) -> Pin<&Slot<T>>
where T: Storable + 'static,

Returns a reference to the slot for a specific type. Read more
Source§

impl<T: Debug, U: Debug> Debug for Cons<T, U>

Source§

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

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

impl<T, R> IntoSlots for Cons<T, R>
where T: Storable + 'static, R: IntoSlots,

Source§

type Slots = Cons<Slot<T>, <R as IntoSlots>::Slots>

A cons-list that contains a slot for every type in this cons-list.
Source§

fn make_slots() -> Self::Slots

Creates a new instance of the slot cons-list with all slots empty.
Source§

impl<T, U> NestedAccessCount for Cons<T, U>

Source§

fn writers(type_id: TypeId) -> usize

Returns how many writers for the given type exist in this list of lists.
Source§

fn readers(type_id: TypeId) -> usize

Returns how many readers for the given type exist in this list of lists (both exclusive and non-exclusive).
Source§

fn exclusive_readers(type_id: TypeId) -> usize

Returns how many exclusive readers for the given type exist in this list of lists.
Source§

impl<T: PartialEq, U: PartialEq> PartialEq for Cons<T, U>

Source§

fn eq(&self, other: &Cons<T, U>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<U, R> Slots for Cons<Slot<U>, R>
where U: Storable + 'static, R: Slots,

Source§

fn slot<T>(self: Pin<&Self>) -> Pin<&Slot<T>>
where T: Storable + 'static,

Source§

fn all_slots() -> impl Iterator<Item = (TypeId, &'static str)>

Returns the TypeId and type names for all the slots stored in this type.
Source§

impl<T: Copy, U: Copy> Copy for Cons<T, U>

Source§

impl<T: Eq, U: Eq> Eq for Cons<T, U>

Source§

impl<T, U> StructuralPartialEq for Cons<T, U>

Source§

impl<'pin, T, U> Unpin for Cons<T, U>
where PinnedFieldsOf<__Cons<'pin, T, U>>: Unpin,

Auto Trait Implementations§

§

impl<T, U> Freeze for Cons<T, U>
where T: Freeze, U: Freeze,

§

impl<T, U> RefUnwindSafe for Cons<T, U>

§

impl<T, U> Send for Cons<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for Cons<T, U>
where T: Sync, U: Sync,

§

impl<T, U> UnwindSafe for Cons<T, U>
where T: UnwindSafe, U: 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V