[][src]Struct fastobo::ast::Xref

pub struct Xref { /* fields omitted */ }

A database cross-reference definition.

Cross-references can be used in Def or Synonym clauses of entity frames to add sources for the provided definition or evidence to show the actual existence of a synonym. They can also be found in Xref clauses when the cross-reference is directly relevant to the annotated entity (e.g. when exporting an ontology from a knowledge-base to add an hyperlink to the original resource).

Methods

impl Xref[src]

pub fn new<I>(id: I) -> Self where
    I: Into<Ident>, 
[src]

Create a new Xref from the given ID, without description.

pub fn with_desc<I, D>(id: I, desc: D) -> Self where
    I: Into<Ident>,
    D: Into<Option<QuotedString>>, 
[src]

Create a new Xref with the given ID and optional description.

pub fn id(&self) -> &Ident[src]

Get a mutable reference to the identifier of the xref.

pub fn id_mut(&mut self) -> &mut Ident[src]

Get a reference to the identifier of the xref.

pub fn description(&self) -> Option<&QuotedString>[src]

Get a reference to the description of the xref, if any.

pub fn description_mut(&mut self) -> Option<&mut QuotedString>[src]

Get a mutable reference to the description of the xref, if any.

Trait Implementations

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

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

Create a new instance from a Pair.

impl Identified for Xref[src]

impl Clone for Xref[src]

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

Performs copy-assignment from source. Read more

impl Ord for Xref[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 Eq for Xref[src]

impl PartialOrd<Xref> for Xref[src]

impl PartialEq<Xref> for Xref[src]

impl Debug for Xref[src]

impl Display for Xref[src]

impl FromStr for Xref[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for Xref[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 FromIterator<Xref> for XrefList[src]

Auto Trait Implementations

impl Send for Xref

impl Sync for Xref

Blanket Implementations

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

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]