[][src]Trait fastobo::semantics::OboClause

pub trait OboClause {
    fn tag(&self) -> &str;
fn cardinality(&self) -> Cardinality; }

Common attributes and operations for all clauses.

Required methods

fn tag(&self) -> &str

Get the raw string corresponding to the tag of a clause.

Example

let clause = HeaderClause::SavedBy("Martin Larralde".into());
assert_eq!(clause.tag(), "saved-by");

fn cardinality(&self) -> Cardinality

Get the cardinality expected for a clause variant.

While most clauses can appear any number of time in a frame, some have a constraint on how many time they can appear: for instance, a namespace clause must appear exactly once in every entity frame, and an intersection_of clause cannot appear only once.

Example

let clause = HeaderClause::SavedBy("Martin Larralde".into());
assert_eq!(clause.cardinality(), Cardinality::ZeroOrOne);
Loading content...

Implementors

impl OboClause for HeaderClause[src]

impl OboClause for InstanceClause[src]

impl OboClause for TermClause[src]

impl OboClause for TypedefClause[src]

Loading content...