[][src]Trait atelier_core::model::Annotated

pub trait Annotated {
    fn has_traits(&self) -> bool;
fn has_trait(&self, id: &ShapeID) -> bool;
fn traits(&self) -> &Vec<Trait>;
fn add_trait(&mut self, a_trait: Trait);
fn remove_trait(&mut self, id: &ShapeID); fn append_traits(&mut self, traits: &[Trait]) { ... }
fn documentation(&mut self, doc: &str) { ... } }

A trait implemented by model elements that may have traits applied to them.

Required methods

fn has_traits(&self) -> bool

Returns true if the model element has any applied traits, else false.

fn has_trait(&self, id: &ShapeID) -> bool

Returns true if the model element has any applied traits with the associated id, else false.

fn traits(&self) -> &Vec<Trait>

Return an iterator over all traits applied to this model element

fn add_trait(&mut self, a_trait: Trait)

Add a new trait to this model element.

fn remove_trait(&mut self, id: &ShapeID)

Remove any trait from this model element with the provided id.

Loading content...

Provided methods

fn append_traits(&mut self, traits: &[Trait])

Add all the traits to this model element.

fn documentation(&mut self, doc: &str)

A short-cut to add the standard documentation trait.

Loading content...

Implementors

impl Annotated for Member[src]

impl Annotated for Shape[src]

Loading content...