pub struct FoldPlan {
pub target: TypeRef,
pub by_ref: bool,
pub shape: FoldShape,
pub leaves: Vec<FoldLeaf>,
pub selector: Option<usize>,
pub present: Option<usize>,
pub variants: Vec<FoldVariant>,
}Expand description
A resolved expansion for one (function, parameter).
Fields§
§target: TypeRefOwned type the core construct produces — what the underlying call needs
(before any Self::shape wrapping). A reading: target.spell()
for generated Rust, target.key() for a lookup.
by_ref: boolTrue when the original parameter was &T / Option<&T>: the call
receives &folded (or folded.as_ref() when also optional). A
call-site concern (the resolver’s &_ handler shares the inner
converter the same way), not part of the fold.
shape: FoldShapeOuter shape over the core construct (Construct for a plain T/&T
param; Optional(Construct) for Option<T>/Option<&T>).
leaves: Vec<FoldLeaf>Flattened wire leaves, in foreign-signature order.
selector: Option<usize>Index into Self::leaves of the selector leaf; None for a single
constructor (the sole variant is applied unconditionally). Under an
Optional shape the selector also encodes
absence: -1 = None, 0..n-1 = the taken arm.
present: Option<usize>Index into Self::leaves of the explicit presence-flag (bool) leaf
for a multi-argument Optional shape (Option<T> built from a
constructor taking ≥2 args): the flag decides Some/None, the arg
leaves are plain (non-Option). None for a non-optional fold or the
legacy single-arg Optional (where presence rides the sole leaf’s own
Option-ness). A separate flag avoids boxing a nullable primitive arg
(e.g. Option<i32> → Integer?) on the wire.
variants: Vec<FoldVariant>Dispatch arms — one for a single constructor, selector order for a combined one.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Send for FoldPlan
impl !Sync for FoldPlan
impl Freeze for FoldPlan
impl RefUnwindSafe for FoldPlan
impl Unpin for FoldPlan
impl UnsafeUnpin for FoldPlan
impl UnwindSafe for FoldPlan
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