[−][src]Struct fastobo::ast::PrefixedIdent
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]
P: Into<IdentPrefix>,
L: Into<IdentLocal>,
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]
const RULE: Rule
[src]
unsafe fn from_pair_unchecked(pair: Pair<'i, Rule>) -> Result<Self, SyntaxError>
[src]
fn from_pair(pair: Pair<'i, Rule>) -> Result<Self, SyntaxError>
[src]
Create a new instance from a Pair
.
impl<'a> Share<'a, PrefixedId<'a>> for PrefixedIdent
[src]
fn share(&'a self) -> PrefixedId<'a>
[src]
impl Clone for PrefixedIdent
[src]
fn clone(&self) -> 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 cmp(&self, other: &PrefixedIdent) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl From<PrefixedIdent> for Ident
[src]
fn from(id: PrefixedIdent) -> Self
[src]
impl From<PrefixedIdent> for ClassIdent
[src]
fn from(id: PrefixedIdent) -> Self
[src]
impl From<PrefixedIdent> for InstanceIdent
[src]
fn from(id: PrefixedIdent) -> Self
[src]
impl From<PrefixedIdent> for NamespaceIdent
[src]
fn from(id: PrefixedIdent) -> Self
[src]
impl From<PrefixedIdent> for RelationIdent
[src]
fn from(id: PrefixedIdent) -> Self
[src]
impl From<PrefixedIdent> for SubsetIdent
[src]
fn from(id: PrefixedIdent) -> Self
[src]
impl From<PrefixedIdent> for SynonymTypeIdent
[src]
fn from(id: PrefixedIdent) -> Self
[src]
impl PartialOrd<PrefixedIdent> for PrefixedIdent
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[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]
fn eq(&self, other: &PrefixedIdent) -> bool
[src]
fn ne(&self, other: &PrefixedIdent) -> bool
[src]
impl Eq for PrefixedIdent
[src]
impl Display for PrefixedIdent
[src]
impl Debug for PrefixedIdent
[src]
impl Hash for PrefixedIdent
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromStr for PrefixedIdent
[src]
Auto Trait Implementations
impl Sync for PrefixedIdent
impl Send for PrefixedIdent
impl Unpin for PrefixedIdent
impl RefUnwindSafe for PrefixedIdent
impl UnwindSafe for PrefixedIdent
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,