Struct savvy_bindgen::SavvyFn

source ·
pub struct SavvyFn {
    pub docs: Vec<String>,
    pub attrs: Vec<Attribute>,
    pub fn_name: Ident,
    pub fn_type: SavvyFnType,
    pub args: Vec<SavvyFnArg>,
    pub return_type: SavvyFnReturnType,
    pub stmts_orig: Vec<Stmt>,
    pub stmts_additional: Vec<Stmt>,
}

Fields§

§docs: Vec<String>

Doc comments

§attrs: Vec<Attribute>

Attributes except for #[savvy]

§fn_name: Ident

Original function name

§fn_type: SavvyFnType

type path of self in the case of impl function

§args: Vec<SavvyFnArg>

Function arguments

§return_type: SavvyFnReturnType

Return type of the function

§stmts_orig: Vec<Stmt>

Original body of the function

§stmts_additional: Vec<Stmt>

Additional lines to convert SEXP to the specific types

Implementations§

source§

impl SavvyFn

source

pub fn get_c_args(&self) -> Vec<(String, String)>

source§

impl SavvyFn

source

pub fn fn_name_r(&self) -> Ident

source§

impl SavvyFn

source§

impl SavvyFn

source

pub fn fn_name_inner(&self) -> Ident

source

pub fn fn_name_outer(&self) -> Ident

source

pub fn from_fn(orig: &ItemFn) -> Result<Self>

source

pub fn from_impl_fn(orig: &ImplItemFn, fn_type: SavvyFnType) -> Result<Self>

source

pub fn new( attrs: &[Attribute], sig: &Signature, block: &Block, fn_type: SavvyFnType ) -> Result<Self>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.