pub struct MethodDef {
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,
}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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MethodDef
impl<'de> Deserialize<'de> for MethodDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MethodDef
impl RefUnwindSafe for MethodDef
impl Send for MethodDef
impl Sync for MethodDef
impl Unpin for MethodDef
impl UnsafeUnpin for MethodDef
impl UnwindSafe for MethodDef
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
Mutably borrows from an owned value. Read more