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

pub struct FileFragment { /* fields omitted */ }

Fragment for an entire code file. Doesn't actually implement CodeFragment because this is supposed to be top-level and not nested or appended to anything else.

Implementations

impl FileFragment[src]

pub fn new() -> Self[src]

Get a new default FileFragment to use.

pub fn set_preamble(&mut self, preamble: AtomicFragment)[src]

Set a preamble for this file. Preambles are like hashbangs or module tags.

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

Add another fragment to this top-level file fragment.

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

Add test code to the test module for this file.

pub fn generate_code(&self) -> String[src]

Get the code for this fragment.

Trait Implementations

impl Default for FileFragment[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