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§
Sourcefn mark_as_public(&mut self)
fn mark_as_public(&mut self)
Mark this as a public declaration.
Sourcefn add_attribute(&mut self, attribute: String)
fn add_attribute(&mut self, attribute: String)
Add an attribute to the declaration.
Sourcefn set_body(&mut self, body: Rc<RefCell<dyn CodeFragment>>)
fn set_body(&mut self, body: Rc<RefCell<dyn CodeFragment>>)
Set an implementation to go along with the declaration.
Sourcefn mark_as_declare_only(&mut self)
fn mark_as_declare_only(&mut self)
Declares the item without implementing it.
Sourcefn mark_for_full_implementation(&mut self)
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".