Enum fastobo::semantics::Cardinality[][src]

pub enum Cardinality {
    ZeroOrOne,
    One,
    NotOne,
    Any,
}

The cardinality constraint for a given clause type.

Variants

ZeroOrOne
One
NotOne
Any

Implementations

impl Cardinality[src]

pub fn is_match(&self, n: usize) -> bool[src]

Return true if the cardinality matches the gievn element count.

pub fn to_error<S: Into<String>>(
    &self,
    n: usize,
    tag: S
) -> Option<CardinalityError>
[src]

Given a tag name, build an error from this cardinality if the count does not match.

Trait Implementations

impl Clone for Cardinality[src]

impl Debug for Cardinality[src]

impl Eq for Cardinality[src]

impl PartialEq<Cardinality> for Cardinality[src]

impl StructuralEq for Cardinality[src]

impl StructuralPartialEq for Cardinality[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.