Skip to main content

StackConcat

Struct StackConcat 

Source
pub struct StackConcat<A, B>(pub A, pub B);
Expand description

Concatenates two arm stacks into one, running both concurrently.

Arm indices from A are 0..A::SIZE; arm indices from B are offset by A::SIZE. Outputs are (A::Outputs, B::Outputs).

Tuple Fields§

§0: A§1: B

Trait Implementations§

Source§

impl<'de, KP, A, B> MapArmStack<'de, KP> for StackConcat<A, B>
where KP: MapKeyProbe<'de>, A: MapArmStack<'de, KP>, B: MapArmStack<'de, KP>,

Source§

const SIZE: usize

Source§

type Outputs = (<A as MapArmStack<'de, KP>>::Outputs, <B as MapArmStack<'de, KP>>::Outputs)

Left-nested tuple of Option<(K, V)> for each arm.
Source§

type RaceState = ConcatRaceState<<A as MapArmStack<'de, KP>>::RaceState, <B as MapArmStack<'de, KP>>::RaceState>

Source§

type DispatchState = ConcatDispatchState<<A as MapArmStack<'de, KP>>::DispatchState, <B as MapArmStack<'de, KP>>::DispatchState>

Source§

fn unsatisfied_count(&self) -> usize

Number of arms that still require a value (required fields not yet matched). Virtual arms are excluded.
Source§

fn open_count(&self) -> usize

Number of arms still willing to run, including virtual arms.
Source§

fn init_race(&mut self, kp: KP) -> Self::RaceState

Source§

fn poll_race_one( &mut self, state: Pin<&mut Self::RaceState>, arm_index: usize, cx: &mut Context<'_>, ) -> Poll<Result<Probe<(usize, KP::KeyClaim)>, KP::Error>>

Source§

fn init_dispatch( &mut self, arm_index: usize, vp: VP<'de, KP>, ) -> Self::DispatchState

Source§

fn poll_dispatch( &mut self, state: Pin<&mut Self::DispatchState>, cx: &mut Context<'_>, ) -> Poll<Result<Probe<(VC<'de, KP>, ())>, KP::Error>>

Source§

fn take_outputs(&mut self) -> Self::Outputs

Source§

async fn race_keys( &mut self, kp: KP, ) -> Result<Probe<(usize, KP::KeyClaim)>, KP::Error>

Race all unsatisfied arms’ key callbacks against the given key probe.
Source§

async fn dispatch_value( &mut self, arm_index: usize, vp: VP<'de, KP>, ) -> Result<Probe<(VC<'de, KP>, ())>, KP::Error>

Dispatch the value probe to the arm at arm_index.
Source§

impl<KP, A, B> MapArmStackOwned<KP> for StackConcat<A, B>

Source§

const SIZE: usize

Source§

type Outputs = (<A as MapArmStackOwned<KP>>::Outputs, <B as MapArmStackOwned<KP>>::Outputs)

Left-nested tuple of Option<(K, V)> for each arm.
Source§

type RaceState = ConcatRaceState<<A as MapArmStackOwned<KP>>::RaceState, <B as MapArmStackOwned<KP>>::RaceState>

Pinned state holding per-arm key futures for one round of racing.
Source§

type DispatchState = ConcatDispatchState<<A as MapArmStackOwned<KP>>::DispatchState, <B as MapArmStackOwned<KP>>::DispatchState>

Pinned state for dispatching the winning arm’s value callback. Only one arm is dispatched per call (the race winner).
Source§

fn unsatisfied_count(&self) -> usize

Number of arms that still require a value (required fields not yet matched). Virtual arms (skip-unknown, dup-detect, tag-inject) are excluded.
Source§

fn open_count(&self) -> usize

Number of arms still willing to run, including both unsatisfied required-field arms and always-active virtual arms.
Source§

fn init_race(&mut self, kp: KP) -> Self::RaceState

Fork kp for each unsatisfied arm, call each arm’s key callback to create its future, and return the combined pinned state.
Source§

fn poll_race_one( &mut self, state: Pin<&mut Self::RaceState>, arm_index: usize, cx: &mut Context<'_>, ) -> Poll<Result<Probe<(usize, KP::KeyClaim)>, KP::Error>>

Poll a single arm’s key future. Sync - recursion through (Rest, Slot) is ordinary function calls, not async nesting.
Source§

fn init_dispatch(&mut self, arm_index: usize, vp: VP<KP>) -> Self::DispatchState

Create the dispatch state for the winning arm at arm_index.
Source§

fn poll_dispatch( &mut self, state: Pin<&mut Self::DispatchState>, cx: &mut Context<'_>, ) -> Poll<Result<Probe<(VC<KP>, ())>, KP::Error>>

Poll the dispatch future.
Source§

fn take_outputs(&mut self) -> Self::Outputs

Extract all outputs.
Source§

async fn race_keys( &mut self, kp: KP, ) -> Result<Probe<(usize, KP::KeyClaim)>, KP::Error>

Race all unsatisfied arms’ key callbacks against the given key probe. Read more
Source§

async fn dispatch_value( &mut self, arm_index: usize, vp: VP<KP>, ) -> Result<Probe<(VC<KP>, ())>, KP::Error>

Dispatch the value probe to the arm at arm_index. Read more

Auto Trait Implementations§

§

impl<A, B> Freeze for StackConcat<A, B>
where A: Freeze, B: Freeze,

§

impl<A, B> RefUnwindSafe for StackConcat<A, B>

§

impl<A, B> Send for StackConcat<A, B>
where A: Send, B: Send,

§

impl<A, B> Sync for StackConcat<A, B>
where A: Sync, B: Sync,

§

impl<A, B> Unpin for StackConcat<A, B>
where A: Unpin, B: Unpin,

§

impl<A, B> UnsafeUnpin for StackConcat<A, B>
where A: UnsafeUnpin, B: UnsafeUnpin,

§

impl<A, B> UnwindSafe for StackConcat<A, B>
where A: UnwindSafe, B: 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> 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, 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.