[−][src]Trait fastobo::semantics::OboClause
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);