[][src]Struct fastobo::ast::PrefixedIdent

pub struct PrefixedIdent { /* fields omitted */ }

An identifier with a prefix.

Methods

impl PrefixedIdent[src]

pub fn new<P, L>(prefix: P, local: L) -> Self where
    P: Into<IdentPrefix>,
    L: Into<IdentLocal>, 
[src]

Create a new PrefixedIdent from a prefix and a local identifier.

Thanks to conversion traits, the prefix and local arguments can be passed either as strings or ast structures:

let id1 = PrefixedIdent::new("MS", "1000031");
let id2 = PrefixedIdent::new(IdentPrefix::new("MS"), IdentLocal::new("1000031"));
assert_eq!(id1, id2);

Example

pub fn is_canonical(&self) -> bool[src]

Check if the prefixed identifier is canonical or not.

Example

let canonical_id = PrefixedIdent::from_str("GO:0046154").unwrap();
assert!(canonical_id.is_canonical());

let noncanonical_id = PrefixedIdent::from_str("PATO:something").unwrap();
assert!(!noncanonical_id.is_canonical());

pub fn prefix(&self) -> &IdentPrefix[src]

Get a reference to the prefix of the PrefixedIdent.

pub fn prefix_mut(&mut self) -> &mut IdentPrefix[src]

Get a mutable reference to the prefix of the PrefixedIdent.

pub fn local(&self) -> &IdentLocal[src]

Get a reference to the local component of the PrefixedIdent.

pub fn local_mut(&mut self) -> &mut IdentLocal[src]

Get a mutable reference to the local component of the PrefixedIdent.

Trait Implementations

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

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

Create a new instance from a Pair.

impl<'a> Share<'a, PrefixedId<'a>> for PrefixedIdent[src]

impl Clone for PrefixedIdent[src]

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

Performs copy-assignment from source. Read more

impl Ord for PrefixedIdent[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 From<PrefixedIdent> for Ident[src]

impl From<PrefixedIdent> for ClassIdent[src]

impl From<PrefixedIdent> for InstanceIdent[src]

impl From<PrefixedIdent> for NamespaceIdent[src]

impl From<PrefixedIdent> for RelationIdent[src]

impl From<PrefixedIdent> for SubsetIdent[src]

impl From<PrefixedIdent> for SynonymTypeIdent[src]

impl Eq for PrefixedIdent[src]

impl PartialOrd<PrefixedIdent> for PrefixedIdent[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialEq<PrefixedIdent> for PrefixedIdent[src]

impl Debug for PrefixedIdent[src]

impl Display for PrefixedIdent[src]

impl FromStr for PrefixedIdent[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for PrefixedIdent[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

Auto Trait Implementations

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]