pub struct Prefix<'a>(/* private fields */);Expand description
The representation of the prefix of a TermId.
§Examples
Prefix can be obtained from a TermId:
use ontolius::TermId;
let seizure: TermId = "HP:0001250".parse().unwrap();
let prefix = seizure.prefix();Prefix can be tested for equality with a &str or with another prefix.
let arachnodactyly: TermId = "HP:0001166".parse().unwrap();
assert!(&prefix == "HP");
assert!(&arachnodactyly.prefix() == &prefix);Prefix implements PartialOrd and Ord traits.
Note that no particular order (e.g. alphabetical) is guaranteed.
Only that the ordering is defined.
Prefix can be hashed (Hash).
Prefix implements std::fmt::Debug and Display.
assert_eq!(prefix.to_string(), String::from("HP"));Trait Implementations§
Source§impl Ord for Prefix<'_>
impl Ord for Prefix<'_>
Source§impl PartialEq<str> for Prefix<'_>
Prefix can be tested for equality with a &str.
impl PartialEq<str> for Prefix<'_>
Prefix can be tested for equality with a &str.
use ontolius::TermId;
let term_id: TermId = "HP:0001250".parse().unwrap();
assert!(&term_id.prefix() == "HP");Source§impl<'a> PartialOrd for Prefix<'a>
impl<'a> PartialOrd for Prefix<'a>
impl<'a> Eq for Prefix<'a>
Auto Trait Implementations§
impl<'a> Freeze for Prefix<'a>
impl<'a> RefUnwindSafe for Prefix<'a>
impl<'a> Send for Prefix<'a>
impl<'a> Sync for Prefix<'a>
impl<'a> Unpin for Prefix<'a>
impl<'a> UnwindSafe for Prefix<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more