[][src]Struct fastobo::ast::Line

pub struct Line<T> { /* fields omitted */ }

A line in an OBO file, possibly followed by qualifiers and a comment.

Methods

impl<T> Line<T>[src]

pub fn and_comment<C>(self, comment: C) -> Self where
    C: Into<Option<Comment>>, 
[src]

Update the line comment with the given one.

Example

let line = Line::from(TermClause::IsObsolete(true))
    .and_comment(Comment::new("deprecated in v3"));
assert_eq!(line.to_string(), "is_obsolete: true ! deprecated in v3\n");

pub fn and_qualifiers<Q>(self, qualifiers: Q) -> Self where
    Q: Into<Option<QualifierList>>, 
[src]

Update the line qualifier list with the given one.

pub fn qualifiers(&self) -> Option<&QualifierList>[src]

pub fn qualifiers_mut(&mut self) -> Option<&mut QualifierList>[src]

pub fn comment(&self) -> Option<&Comment>[src]

pub fn comment_mut(&mut self) -> Option<&mut Comment>[src]

pub fn as_inner(&self) -> &T[src]

Get a reference to the OBO clause wrapped in the line.

pub fn into_inner(self) -> T[src]

Get the actual OBO clause wrapped in the line.

Trait Implementations

impl<'i> FromPair<'i> for Line<InstanceClause>[src]

fn from_pair(pair: Pair<'i, Rule>) -> Result<Self, Error>[src]

Create a new instance from a Pair.

impl<'i> FromPair<'i> for Line<TermClause>[src]

fn from_pair(pair: Pair<'i, Rule>) -> Result<Self, Error>[src]

Create a new instance from a Pair.

impl<'i> FromPair<'i> for Line<TypedefClause>[src]

fn from_pair(pair: Pair<'i, Rule>) -> Result<Self, Error>[src]

Create a new instance from a Pair.

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

impl From<Line<ClassIdent>> for TermFrame[src]

Create a new term frame with the frame ID given as a Line.

impl<T: Ord> Ord for Line<T>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<T> AsRef<T> for Line<T>[src]

impl<T> AsMut<T> for Line<T>[src]

impl<T: PartialEq> PartialEq<Line<T>> for Line<T>[src]

impl<T: PartialOrd> PartialOrd<Line<T>> for Line<T>[src]

impl<T: Eq> Eq for Line<T>[src]

impl<T: Clone> Clone for Line<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T> Deref for Line<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Line<T>[src]

impl<T: Hash> Hash for Line<T>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Debug> Debug for Line<T>[src]

impl<T> Display for Line<T> where
    T: Display
[src]

impl FromStr for Line<InstanceClause>[src]

type Err = Error

The associated error which can be returned from parsing.

impl FromStr for Line<TermClause>[src]

type Err = Error

The associated error which can be returned from parsing.

impl FromStr for Line<TypedefClause>[src]

type Err = Error

The associated error which can be returned from parsing.

impl<T> Borrow<T> for Line<T>[src]

impl<T> BorrowMut<T> for Line<T>[src]

Auto Trait Implementations

impl<T> Send for Line<T> where
    T: Send

impl<T> Sync for Line<T> where
    T: Sync

Blanket Implementations

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[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.

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

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

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