[][src]Struct zamm_yang::codegen::template::basic::FunctionFragment

pub struct FunctionFragment { /* fields omitted */ }

Fragment for a function.

Implementations

impl FunctionFragment[src]

pub fn new(name: String) -> Self[src]

Create a new function with the given name.

pub fn mark_as_test(&mut self)[src]

Set the function to be a test function.

pub fn set_return(&mut self, return_type: String)[src]

Set the return type for the function.

pub fn set_self_reference(&mut self, reference: SelfReference)[src]

Set the self reference type for the function, if it's part of a struct or a trait.

pub fn add_arg(&mut self, name: String, arg_type: String)[src]

Add a new argument to the function.

pub fn add_import(&mut self, import: String)[src]

Add a new import for the args or return type.

pub fn append(&mut self, fragment: Rc<RefCell<dyn CodeFragment>>)[src]

Add a fragment to the internals of this function.

Trait Implementations

impl CodeFragment for FunctionFragment[src]

impl Default for FunctionFragment[src]

impl ItemDeclarationAPI for FunctionFragment[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any