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

pub struct PrefixedIdent { /* fields omitted */ }

An identifier with a prefix.

Implementations

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 Clone for PrefixedIdent[src]

impl Debug for PrefixedIdent[src]

impl Display for PrefixedIdent[src]

impl Eq for PrefixedIdent[src]

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<'i> FromPair<'i> for PrefixedIdent[src]

impl FromStr for PrefixedIdent[src]

type Err = SyntaxError

The associated error which can be returned from parsing.

impl Hash for PrefixedIdent[src]

impl Ord for PrefixedIdent[src]

impl PartialEq<PrefixedIdent> for PrefixedIdent[src]

impl PartialOrd<PrefixedIdent> for PrefixedIdent[src]

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

impl StructuralEq for PrefixedIdent[src]

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