[][src]Enum fastobo::ast::EntityFrame

pub enum EntityFrame {
    Term(TermFrame),
    Typedef(TypedefFrame),
    Instance(InstanceFrame),
}

An entity frame, either for a term, an instance, or a typedef.

Variants

Term(TermFrame)
Typedef(TypedefFrame)
Instance(InstanceFrame)

Methods

impl EntityFrame[src]

pub fn as_term_frame(&self) -> Option<&TermFrame>[src]

Return the TermFrame if the entity frame is one, or None.

Use this function in conjunction with Iterator::flat_map to extract all term frames from an iterator of EntityFrame references:

let doc = fastobo::from_file("tests/data/ms.obo").unwrap();
let terms: Vec<&TermFrame> = doc
    .entities()
    .iter()
    .flat_map(EntityFrame::as_term_frame)
    .collect();

pub fn as_typedef_frame(&self) -> Option<&TypedefFrame>[src]

Return the TypedefFrame if the entity frame is one, or None.

pub fn as_instance_frame(&self) -> Option<&InstanceFrame>[src]

Return the InstanceFrame if the entity frame is one, or None.

Trait Implementations

impl<'i> FromPair<'i> for EntityFrame[src]

impl Orderable for EntityFrame[src]

impl Identified for EntityFrame[src]

impl Eq for EntityFrame[src]

impl Clone for EntityFrame[src]

impl PartialEq<EntityFrame> for EntityFrame[src]

impl From<TermFrame> for EntityFrame[src]

impl From<TypedefFrame> for EntityFrame[src]

impl From<InstanceFrame> for EntityFrame[src]

impl Hash for EntityFrame[src]

impl Debug for EntityFrame[src]

impl Display for EntityFrame[src]

impl FromStr for EntityFrame[src]

type Err = SyntaxError

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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

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

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