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

pub struct ItemDeclaration {
    pub doc: Option<String>,
    pub public: bool,
    pub attributes: Vec<String>,
    pub definition: Rc<RefCell<dyn CodeFragment>>,
    pub body: Option<Rc<RefCell<dyn CodeFragment>>>,
}

Fragment containing all universal modifiers for an item declaration.

Fields

doc: Option<String>

Documentation string for the item.

public: bool

Whether or not this item should be publicly exported out of the module.

attributes: Vec<String>

Attributes to be added to the item.

definition: Rc<RefCell<dyn CodeFragment>>

Actual definition of the item, whether it be a variable, function, or module.

body: Option<Rc<RefCell<dyn CodeFragment>>>

Some items, such as functions and submodules, may have actual implementations that go along with their declaration.

Implementations

impl ItemDeclaration[src]

pub fn new(definition: Rc<RefCell<dyn CodeFragment>>) -> Self[src]

Create a new item declaration.

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

Set the fragment that defines this item.

Trait Implementations

impl Clone for ItemDeclaration[src]

impl CodeFragment for ItemDeclaration[src]

impl Default for ItemDeclaration[src]

impl ItemDeclarationAPI for ItemDeclaration[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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