pub struct MethodDef {Show 13 fields
pub name: String,
pub params: Vec<ParamDef>,
pub return_type: TypeRef,
pub is_async: bool,
pub is_static: bool,
pub error_type: Option<String>,
pub doc: String,
pub receiver: Option<ReceiverKind>,
pub sanitized: bool,
pub trait_source: Option<String>,
pub returns_ref: bool,
pub returns_cow: bool,
pub return_newtype_wrapper: Option<String>,
}Expand description
A method on a public struct.
Fields§
§name: String§params: Vec<ParamDef>§return_type: TypeRef§is_async: bool§is_static: bool§error_type: Option<String>§doc: String§receiver: Option<ReceiverKind>§sanitized: boolTrue if any param or return type was sanitized during unknown type resolution. Methods with sanitized signatures cannot be auto-delegated.
trait_source: Option<String>Fully qualified trait path if this method comes from a trait impl (e.g. “liter_llm::LlmClient”). None for inherent methods.
returns_ref: boolTrue if the core function returns a reference (&T, Option<&T>, etc.).
Used by code generators to insert .clone() before type conversion.
returns_cow: boolTrue if the core function returns Cow<'_, T> where T is a named type (not str/bytes).
Used by code generators to emit .into_owned() before type conversion.
return_newtype_wrapper: Option<String>Full Rust path of the newtype wrapper that was resolved away for the return type,
e.g. "my_crate::NodeIndex" when the return type NodeIndex(u32) was resolved to u32.
When set, codegen must unwrap the returned newtype value (e.g. result.0) before returning.