Skip to main content

FnResult

Enum FnResult 

Source
pub enum FnResult {
    Data {
        handle: HandleId,
        tracked: Option<Vec<usize>>,
    },
    Noop {
        tracked: Option<Vec<usize>>,
    },
    Batch {
        emissions: SmallVec<[FnEmission; 2]>,
        tracked: Option<Vec<usize>>,
    },
}
Expand description

What the binding side returns when the Core invokes a fn via BindingBoundary::invoke_fn.

Models the three emission modes from the canonical spec:

  • FnResult::Data — single DATA, equals substitution applies (R1.3.2). Maps to actions.emit(v) in sugar constructors.
  • FnResult::Batch — multi-message wave, no equals substitution (R1.3.2.d / R1.3.3.c). Maps to actions.down(msgs).
  • FnResult::Noop — no emission. RESOLVED if node was DIRTY.

Per R2.4.5, the fn return value in the canonical spec is cleanup hooks only — all emission is explicit via actions. The Rust Core folds the emission into FnResult as a pragmatic simplification; the binding layer maps between the two representations.

Variants§

§

Data

fn produced a single value. The Core treats this as outgoing DATA — equals-substitution against the cache may rewrite it to RESOLVED on the wire (R1.3.2).

Fields

§handle: HandleId
§tracked: Option<Vec<usize>>

For dynamic nodes only: the dep indices fn actually read this run. Static derived nodes pass None. See dynamic-node semantics in the canonical spec §2.8 / Lock 2.B.

§

Noop

fn ran but produced no emission this wave. The Core sends RESOLVED to subscribers if the node was already DIRTY this wave; otherwise no outgoing message.

Fields

§tracked: Option<Vec<usize>>

Same as Data::tracked — dynamic nodes only.

§

Batch

Multi-message wave — models actions.down(msgs). Emissions are processed in sequence within the same wave. No equals substitution on any Data emission (R1.3.2.d: substitution only on single-DATA waves; R1.3.3.c: multi-DATA passes verbatim). DIRTY auto-prefix only on first Data per R1.3.1.a.

Fields

§emissions: SmallVec<[FnEmission; 2]>
§tracked: Option<Vec<usize>>

Same as Data::tracked — dynamic nodes only.

Trait Implementations§

Source§

impl Clone for FnResult

Source§

fn clone(&self) -> FnResult

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 Debug for FnResult

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.