Struct fastobo::ast::PrefixedIdent
source · pub struct PrefixedIdent { /* private fields */ }
Expand description
An identifier with a prefix.
Implementations§
source§impl PrefixedIdent
impl PrefixedIdent
sourcepub fn new<P, L>(prefix: P, local: L) -> Selfwhere
P: Into<IdentType>,
L: Into<IdentType>,
pub fn new<P, L>(prefix: P, local: L) -> Selfwhere P: Into<IdentType>, L: Into<IdentType>,
Create a new PrefixedIdent
from a prefix and a local identifier.
let id1 = PrefixedIdent::new("MS", "1000031");
let id2 = PrefixedIdent::from_str("MS:1000031").unwrap();
assert_eq!(id1, id2);
sourcepub fn is_canonical(&self) -> bool
pub fn is_canonical(&self) -> bool
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());
Trait Implementations§
source§impl Clone for PrefixedIdent
impl Clone for PrefixedIdent
source§fn clone(&self) -> PrefixedIdent
fn clone(&self) -> PrefixedIdent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PrefixedIdent
impl Debug for PrefixedIdent
source§impl Display for PrefixedIdent
impl Display for PrefixedIdent
source§impl From<PrefixedIdent> for ClassIdent
impl From<PrefixedIdent> for ClassIdent
source§fn from(id: PrefixedIdent) -> Self
fn from(id: PrefixedIdent) -> Self
Converts to this type from the input type.
source§impl From<PrefixedIdent> for Ident
impl From<PrefixedIdent> for Ident
source§fn from(id: PrefixedIdent) -> Self
fn from(id: PrefixedIdent) -> Self
Converts to this type from the input type.
source§impl From<PrefixedIdent> for InstanceIdent
impl From<PrefixedIdent> for InstanceIdent
source§fn from(id: PrefixedIdent) -> Self
fn from(id: PrefixedIdent) -> Self
Converts to this type from the input type.
source§impl From<PrefixedIdent> for NamespaceIdent
impl From<PrefixedIdent> for NamespaceIdent
source§fn from(id: PrefixedIdent) -> Self
fn from(id: PrefixedIdent) -> Self
Converts to this type from the input type.
source§impl From<PrefixedIdent> for RelationIdent
impl From<PrefixedIdent> for RelationIdent
source§fn from(id: PrefixedIdent) -> Self
fn from(id: PrefixedIdent) -> Self
Converts to this type from the input type.
source§impl From<PrefixedIdent> for SubsetIdent
impl From<PrefixedIdent> for SubsetIdent
source§fn from(id: PrefixedIdent) -> Self
fn from(id: PrefixedIdent) -> Self
Converts to this type from the input type.
source§impl From<PrefixedIdent> for SynonymTypeIdent
impl From<PrefixedIdent> for SynonymTypeIdent
source§fn from(id: PrefixedIdent) -> Self
fn from(id: PrefixedIdent) -> Self
Converts to this type from the input type.
source§impl<'i> FromPair<'i> for PrefixedIdent
impl<'i> FromPair<'i> for PrefixedIdent
source§impl FromStr for PrefixedIdent
impl FromStr for PrefixedIdent
source§impl Hash for PrefixedIdent
impl Hash for PrefixedIdent
source§impl Ord for PrefixedIdent
impl Ord for PrefixedIdent
source§fn cmp(&self, other: &PrefixedIdent) -> Ordering
fn cmp(&self, other: &PrefixedIdent) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<PrefixedIdent> for PrefixedIdent
impl PartialEq<PrefixedIdent> for PrefixedIdent
source§fn eq(&self, other: &PrefixedIdent) -> bool
fn eq(&self, other: &PrefixedIdent) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<PrefixedIdent> for PrefixedIdent
impl PartialOrd<PrefixedIdent> for PrefixedIdent
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for PrefixedIdent
impl StructuralEq for PrefixedIdent
impl StructuralPartialEq for PrefixedIdent
Auto Trait Implementations§
impl RefUnwindSafe for PrefixedIdent
impl Send for PrefixedIdent
impl Sync for PrefixedIdent
impl Unpin for PrefixedIdent
impl UnwindSafe for PrefixedIdent
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more