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.
Trait Implementations§
Source§impl Clone for LeafSource
impl Clone for LeafSource
Source§fn clone(&self) -> LeafSource
fn clone(&self) -> LeafSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LeafSource
impl Debug for LeafSource
Source§impl Default for LeafSource
impl Default for LeafSource
Source§fn default() -> LeafSource
fn default() -> LeafSource
impl Eq for LeafSource
Source§impl PartialEq for LeafSource
impl PartialEq for LeafSource
impl StructuralPartialEq for LeafSource
Auto Trait Implementations§
impl !Send for LeafSource
impl !Sync for LeafSource
impl Freeze for LeafSource
impl RefUnwindSafe for LeafSource
impl Unpin for LeafSource
impl UnsafeUnpin for LeafSource
impl UnwindSafe for LeafSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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