Skip to main content

LambdaExpr

Struct LambdaExpr 

Source
pub struct LambdaExpr {
Show 13 fields pub kind: LambdaKind, pub sam_name: String, pub sam_desc: MethodDescriptor, pub inst_sam_desc: Option<MethodDescriptor>, pub impl_owner: String, pub impl_name: String, pub impl_desc: MethodDescriptor, pub impl_is_static: bool, pub captures: Vec<Expr>, pub param_names: Vec<String>, pub sam_cls: String, pub ref_receiver: Option<String>, pub capture_snaps: Vec<(u32, u32, String)>,
}

Fields§

§kind: LambdaKind§sam_name: String

Functional interface method name/desc for casting ambiguity if needed.

§sam_desc: MethodDescriptor§inst_sam_desc: Option<MethodDescriptor>

LambdaMetafactory instantiatedMethodType (bootstrap arg 2): the SAM descriptor as javac INSTANTIATED it at this site — for .<ConstantDesc>map(Utf8Entry::stringValue) it is (LUtf8Entry;)LConstantDesc; against the erased samMethodType (LObject;)LObject;. The only bytecode record of explicit type arguments on a lambda/method-ref call.

§impl_owner: String

Implementation method (for Lambda kind: the body is emitted from it, or referenced by name when it belongs to another class).

§impl_name: String§impl_desc: MethodDescriptor§impl_is_static: bool§captures: Vec<Expr>

Captured arguments (evaluated at indy call site), in impl-arg order after the SAM parameters.

§param_names: Vec<String>

SAM parameter names (synthesized if absent).

§sam_cls: String

The SAM interface’s internal name (the indy descriptor’s return): a lambda used as a call RECEIVER must print with the source’s SAM cast (((BooleanSupplier) () -> ..).getAsBoolean() — a bare lambda cannot be an owner: 此处不应为 lambda 表达式, jdk26 Proxy).

§ref_receiver: Option<String>

Method-ref receiver class name, for X::y form.

§capture_snaps: Vec<(u32, u32, String)>

Snapshot renames for captured outer locals that are NOT effectively final (the decompiler hoists+reassigns them): (outer var id, impl-method param var id, snapshot name). The method pass declares final T name = outer; before the lambda’s statement and the printer renames the impl param accordingly.

Trait Implementations§

Source§

impl Clone for LambdaExpr

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

Source§

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

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

impl PartialEq for LambdaExpr

Source§

fn eq(&self, other: &Self) -> 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 LambdaExpr

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