Skip to main content

ImplFn

Struct ImplFn 

Source
pub struct ImplFn {
Show 14 fields pub type_name: String, pub fn_name: String, pub trait_name: Option<String>, pub module_path: String, pub qualified_type_name: String, pub qualified_name: String, pub visibility: String, pub cfg_predicates: Vec<String>, pub params: Vec<String>, pub param_types: Vec<String>, pub return_type: String, pub vb_params: Vec<usize>, pub block: Block, pub span: SrcSpan,
}
Expand description

An inherent method on a concrete type.

Fields§

§type_name: String§fn_name: String§trait_name: Option<String>

Implemented trait for trait methods (for example candle_core::Module). None denotes an inherent method.

§module_path: String

Rust module containing the definition ("" means the crate root).

§qualified_type_name: String

Qualified owning type for methods. Empty for free functions.

§qualified_name: String

Fully-qualified function identity.

§visibility: String

Source spelling of the visibility. Private items use the empty string.

§cfg_predicates: Vec<String>

#[cfg(...)] predicates inherited from modules/impls and attached to this function.

§params: Vec<String>

Parameter names in order; used to find which argument is the VarBuilder.

§param_types: Vec<String>

Parameter type source text in the same order as params.

Receivers are represented by their source spelling (self, &self, etc.).

§return_type: String

Explicit return type source text, or () when omitted.

§vb_params: Vec<usize>

Indices of every parameter whose type mentions VarBuilder.

Plural because models routinely take more than one: a constructor may take a frozen base_vb (mmapped weights) and a trainable train_vb (a VarMap). Which builder a tensor came from is the frozen/trainable distinction, so collapsing them would discard the thing the gradient analysis will need most.

§block: Block§span: SrcSpan

Trait Implementations§

Source§

impl Clone for ImplFn

Source§

fn clone(&self) -> ImplFn

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

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.