Skip to main content

LeafSource

Enum LeafSource 

Source
pub enum LeafSource {
    Accessor,
    Field,
    SumTag,
    VariantField {
        variant: Ident,
        member: Member,
    },
}
Expand description

How a leaf’s UnfoldLeaf::path is reached from the decomposed value.

Variants§

§

Accessor

The path is a chain of #[prebindgen] accessor functions: source_module::f(&value), composing nested accessors. Nesting steps that return Option make the leaf nullable. This is the form produced by .deconstructor_record* / .fun_accessor declarations.

§

Field

The path is a chain of struct field idents reached by field access and cloned: value.a.b.clone(). Produced by the synthesized decomposition of a by-value data_class (see ValueDecon); the value’s own fields cross as decoupled leaves and the foreign side reassembles the object (so no Java object is built on the Rust side).

§

SumTag

The synthesized selector of a decomposed sum: an i32 naming which alternative is live. It is not read off the value at all — the emitter assigns it per match arm — so it has no path. Emitted once, ahead of the groups it selects between (see SumDecon).

Its out_ty is the sum, not the i32 — it carries which sum it chooses between, which is how the emitter finds the enum to match. That type is registered and not required (#282): it gets a table cell like every other leaf’s, but no root, because a sum has no whole-value output converter and demanding one would fail resolution over a type that never crosses whole. The reading comes from the declaration — Variant::type_ref — never from an adapter composing one out of a name.

§

VariantField

A payload field of ONE alternative of a decomposed sum, reached through a variant pattern rather than an accessor chain or a field chain: the emitter binds member inside variant’s match arm. The leaf is live only when UnfoldLeaf::group equals the value’s tag; in every other arm its slot carries the wire default.

This is the selector Accessor and Field deliberately lack — both are deterministic products, every record contributing unconditionally.

Fields

§variant: Ident

The variant’s ident as declared in the source enum.

§member: Member

How the payload field is addressed in the arm’s pattern.

Trait Implementations§

Source§

impl Clone for LeafSource

Source§

fn clone(&self) -> LeafSource

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 LeafSource

Source§

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

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

impl Default for LeafSource

Source§

fn default() -> LeafSource

Returns the “default value” for a type. Read more
Source§

impl Eq for LeafSource

Source§

impl PartialEq for LeafSource

Source§

fn eq(&self, other: &LeafSource) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LeafSource

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.