pub struct CategoryId<'a> { /* private fields */ }Expand description
An identifier for arXiv categories, which are composed of an archive and category
Implementations§
Source§impl<'a> CategoryId<'a>
impl<'a> CategoryId<'a>
Sourcepub fn try_new(archive: Archive, subject: &'a str) -> Option<Self>
pub fn try_new(archive: Archive, subject: &'a str) -> Option<Self>
Checks if the string is a valid group identifier, based on the archive and category.
Valid archive identifiers are listed under the official website’s page for category taxonomy.
Sourcepub fn parse_bracketed(s: &'a str) -> Option<Self>
pub fn parse_bracketed(s: &'a str) -> Option<Self>
Parse a bracketed string like [astro-ph.CE]
§Examples
use arxiv::{Archive, CategoryId, Group};
let category = CategoryId::try_from("astro-ph.EP").unwrap();
assert_eq!(category.group(), Group::Physics);
assert_eq!(category.archive(), Archive::AstroPh);
assert_eq!(category.subject(), "EP");Trait Implementations§
Source§impl<'a> Clone for CategoryId<'a>
impl<'a> Clone for CategoryId<'a>
Source§fn clone(&self) -> CategoryId<'a>
fn clone(&self) -> CategoryId<'a>
Returns a duplicate 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<'a> Debug for CategoryId<'a>
impl<'a> Debug for CategoryId<'a>
Source§impl Display for CategoryId<'_>
impl Display for CategoryId<'_>
Source§impl<'a> Hash for CategoryId<'a>
impl<'a> Hash for CategoryId<'a>
Source§impl<'a> Ord for CategoryId<'a>
impl<'a> Ord for CategoryId<'a>
Source§fn cmp(&self, other: &CategoryId<'a>) -> Ordering
fn cmp(&self, other: &CategoryId<'a>) -> 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<'a> PartialEq for CategoryId<'a>
impl<'a> PartialEq for CategoryId<'a>
Source§impl<'a> PartialOrd for CategoryId<'a>
impl<'a> PartialOrd for CategoryId<'a>
Source§impl<'a> TryFrom<&'a str> for CategoryId<'a>
impl<'a> TryFrom<&'a str> for CategoryId<'a>
impl<'a> Copy for CategoryId<'a>
impl<'a> Eq for CategoryId<'a>
impl<'a> StructuralPartialEq for CategoryId<'a>
Auto Trait Implementations§
impl<'a> Freeze for CategoryId<'a>
impl<'a> RefUnwindSafe for CategoryId<'a>
impl<'a> Send for CategoryId<'a>
impl<'a> Sync for CategoryId<'a>
impl<'a> Unpin for CategoryId<'a>
impl<'a> UnwindSafe for CategoryId<'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