pub trait OboClause {
    // Required methods
    fn tag(&self) -> &str;
    fn cardinality(&self) -> Cardinality;
}
Expand description

Common attributes and operations for all clauses.

Required Methods§

source

fn tag(&self) -> &str

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

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

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(Box::new("Martin Larralde".into()));
assert_eq!(clause.cardinality(), Cardinality::ZeroOrOne);

Implementors§