Skip to main content

ArgBinding

Enum ArgBinding 

Source
pub enum ArgBinding<'d> {
Show 17 variants In { formal: Symbol<'d>, actual: Expression<'d>, }, Init { var: Symbol<'d>, }, Out { actual: Expression<'d>, formal: Symbol<'d>, }, Const { var: Symbol<'d>, value: i64, }, ThisOf { var: Symbol<'d>, }, Release { var: Symbol<'d>, }, Step { var: Symbol<'d>, by: i64, }, AssocKey { var: Symbol<'d>, arr: Expression<'d>, path: Vec<NestStep<'d>>, next: bool, }, Capture { temp: u32, value: Expression<'d>, }, AssignCaptured { temp: u32, target: Expression<'d>, nba: bool, }, FromCaptured { temp: u32, formal: Symbol<'d>, }, ToCaptured { temp: u32, formal: Symbol<'d>, }, CallResult { temp: u32, call: Expression<'d>, }, ClassEventLeave, CaptureThis { temp: u32, }, RefOpen { temp: u32, formal: Symbol<'d>, actual: Expression<'d>, }, RefClose { temp: u32, formal: Symbol<'d>, actual: Expression<'d>, },
}
Expand description

One argument transfer of a task call inlined into the process CFG (CfgBuilder::inline_task_call): a task whose body can suspend (@, #, wait, …) cannot be an ordinary compiled function, so its body is walked in place and these run at the start of the inlined region’s blocks. Every symbol named here is one of ProcessCfg::inlined_locals.

Variants§

§

In

formal = actual: an input (or the copy-in of an inout) formal.

Fields

§formal: Symbol<'d>
§actual: Expression<'d>
§

Init

var = its declaration initializer, or its type’s default: an output formal or one of the task’s own locals, at task entry.

Fields

§var: Symbol<'d>
§

Out

actual = formal: an output/inout formal’s copy-back after the body (actual is the lvalue expression).

Fields

§actual: Expression<'d>
§formal: Symbol<'d>
§

Const

var = value: a foreach loop variable’s starting value.

Fields

§var: Symbol<'d>
§value: i64
§

ThisOf

var = the current object: the this of a class-method task inlined for an implicit-this call (run() inside another method), bound in the caller’s context. An explicit receiver (obj.run()) binds through ArgBinding::In instead.

Fields

§var: Symbol<'d>
§

Release

An inlined task’s input formal or entry-initialized local ending with the call (an automatic variable ends with its scope, LRM 6.21): whatever class / collection handles it holds are released (LRM 13.5.1). Runs at the call’s exit block, so return and disable release too.

Fields

§var: Symbol<'d>
§

Step

var += by: a foreach loop variable’s per-iteration step.

Fields

§var: Symbol<'d>
§by: i64
§

AssocKey

void'(arr.first(var)), or with next void'(arr.next(var)): a foreach over the associative array arr walking its keys.

For an associative array nested in a collection (int m[int][string], int q[$][int]), path holds the enclosing foreach levels that select the array from arr (as RepeatCount::NestedSize); empty for arr itself.

Fields

§var: Symbol<'d>
§arr: Expression<'d>
§path: Vec<NestStep<'d>>
§next: bool
§

Capture

lhs = #d rhs; and the other intra-assignment timing controls (LRM 1800-2023 §10.4.1): the right-hand side is evaluated before the wait into the compiler temporary temp (a FrameSlotSource::Temporary frame slot, sized by ProcessCfg::captures[temp])…

Fields

§temp: u32
§value: Expression<'d>
§

AssignCaptured

…and assigned to its target after it.

With nba (lhs <= @(e) rhs;, LRM 1800-2023 §10.4.2) the assignment is a nonblocking one, staged for the NBA region: it runs in the synthetic fork branch [CfgBuilder::walk_nba_event] spawns.

Fields

§temp: u32
§target: Expression<'d>
§nba: bool
§

FromCaptured

formal = temp: a recursive task’s input formal, copied from the call’s evaluated argument (InheritedSlot::Temp) as the forked activation starts ([CfgBuilder::inline_recursive_task]).

Fields

§temp: u32
§formal: Symbol<'d>
§

ToCaptured

temp = formal: a recursive task’s output/inout formal, parked in a compiler temporary as the activation ends so the spawner can copy it back (InheritedSlot::Return).

Fields

§temp: u32
§formal: Symbol<'d>
§

CallResult

Marks capture temporary temp as the value of the inlined call call of a function that spawns processes: the call’s expression reads the temporary (keyed by call_result_key) instead of the function’s shared result variable, which a second call of the same function in the statement, or another override of a virtual method, overwrites. A no-op at run time; ArgBinding::ToCaptured parks the value.

Fields

§temp: u32
§call: Expression<'d>
§

ClassEventLeave

The resume of a mixed @(class_event or signal ...) wait (LRM 1800-2023 9.4.2.1, 15.5): the process leaves the class-event queues it is still queued on (the signal side woke it), so a later trigger of one of those events cannot wake a wait it is no longer in.

§

CaptureThis

temp = the caller’s current object: the receiver slot of a recursive class-method activation called with an implicit this (LRM 1800-2023 8.11, 13.4.1); an explicit receiver is an ordinary ArgBinding::Capture.

Fields

§temp: u32
§

RefOpen

A ref formal bound to element actual = c[i] of a queue or dynamic array (LRM 1800-2023 13.5.2, 7.10.3): opens a runtime reference to the element into the 64-bit temporary temp (the collection’s tracking outdates it on delete / pop / clear / resize), then formal = the element.

Fields

§temp: u32
§formal: Symbol<'d>
§actual: Expression<'d>
§

RefClose

The copy-out of ArgBinding::RefOpen: actual = formal unless the reference temp was outdated meanwhile.

Fields

§temp: u32
§formal: Symbol<'d>
§actual: Expression<'d>

Trait Implementations§

Source§

impl<'d> Clone for ArgBinding<'d>

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<'d> Debug for ArgBinding<'d>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'d> !RefUnwindSafe for ArgBinding<'d>

§

impl<'d> !UnwindSafe for ArgBinding<'d>

§

impl<'d> Freeze for ArgBinding<'d>

§

impl<'d> Send for ArgBinding<'d>

§

impl<'d> Sync for ArgBinding<'d>

§

impl<'d> Unpin for ArgBinding<'d>

§

impl<'d> UnsafeUnpin for ArgBinding<'d>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

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

Source§

fn vzip(self) -> V