Skip to main content

MethodDef

Struct MethodDef 

Source
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: bool

True 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: bool

True if the core function returns a reference (&T, Option<&T>, etc.). Used by code generators to insert .clone() before type conversion.

§returns_cow: bool

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

Trait Implementations§

Source§

impl Clone for MethodDef

Source§

fn clone(&self) -> MethodDef

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MethodDef

Source§

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

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

impl<'de> Deserialize<'de> for MethodDef

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MethodDef

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,