Skip to main content

ItemDeclarationAPI

Trait ItemDeclarationAPI 

Source
pub trait ItemDeclarationAPI {
    // Required methods
    fn mark_as_public(&mut self);
    fn is_public(&self) -> bool;
    fn document(&mut self, documentation: String);
    fn add_attribute(&mut self, attribute: String);
    fn set_body(&mut self, body: Rc<RefCell<dyn CodeFragment>>);
    fn mark_as_declare_only(&mut self);
    fn mark_for_full_implementation(&mut self);
}
Expand description

API for all items to be modified in the same way.

Required Methods§

Source

fn mark_as_public(&mut self)

Mark this as a public declaration.

Source

fn is_public(&self) -> bool

Whether this has been marked as a public declaration or not.

Source

fn document(&mut self, documentation: String)

Set the documentation for the fragment.

Source

fn add_attribute(&mut self, attribute: String)

Add an attribute to the declaration.

Source

fn set_body(&mut self, body: Rc<RefCell<dyn CodeFragment>>)

Set an implementation to go along with the declaration.

Source

fn mark_as_declare_only(&mut self)

Declares the item without implementing it.

Source

fn mark_for_full_implementation(&mut self)

Mark the module as requiring full implementation, even if that implementation is an empty one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§