[−][src]Struct zamm_yang::codegen::template::basic::FunctionFragment
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]
pub fn mark_as_public(&mut self)
[src]
pub fn is_public(&self) -> bool
[src]
pub fn add_attribute(&mut self, attribute: String)
[src]
pub fn document(&mut self, documentation: String)
[src]
pub fn set_body(&mut self, body: Rc<RefCell<dyn CodeFragment>>)
[src]
pub fn mark_as_declare_only(&mut self)
[src]
pub fn mark_for_full_implementation(&mut self)
[src]
Auto Trait Implementations
impl !RefUnwindSafe for FunctionFragment
impl !Send for FunctionFragment
impl !Sync for FunctionFragment
impl Unpin for FunctionFragment
impl !UnwindSafe for FunctionFragment
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,