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

pub struct ModuleFragment { /* fields omitted */ }

Fragment for a module declaration.

Implementations

impl ModuleFragment[src]

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

Create a new module with the given name.

pub fn new_file_module() -> Self[src]

Create a new module that takes up an entire file.

pub fn new_test_module() -> Self[src]

Create a new module with the name tests.

pub fn add_submodule(&mut self, name: String) -> Rc<RefCell<ModuleFragment>>[src]

Adds a submodule to the current module.

pub fn mark_as_test(&mut self)[src]

Mark a module as being a test module.

pub fn mark_as_entire_file(&mut self)[src]

Mark this for generation as an entire file. Skips generation of the mod preamble.

pub fn re_export(&mut self, export: String)[src]

Re-export something so that it looks like it comes from this module.

This usually, but not always, refers to something hidden within a submodule of this module. You can also re-export things from other modules, and they will also appear as if they came from this one.

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

Add a fragment to the internals of this module.

Trait Implementations

impl CodeFragment for ModuleFragment[src]

impl Default for ModuleFragment[src]

impl Eq for ModuleFragment[src]

impl ItemDeclarationAPI for ModuleFragment[src]

impl Ord for ModuleFragment[src]

impl PartialEq<ModuleFragment> for ModuleFragment[src]

impl PartialOrd<ModuleFragment> for ModuleFragment[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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?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