pub struct RuleId(/* private fields */);Expand description
A bookspec rule identifier: BS-<area>-<n> (e.g. BS-entry-1).
The areas are the specification’s subjects (Area), and n counts
from 1 within an area. The catalogue in crate::rules is the list of
every identifier the specification states; an identifier that is not in
it is a typo, not a rule.
Implementations§
Source§impl RuleId
impl RuleId
Sourcepub fn new(area: Area, n: u32) -> Self
pub fn new(area: Area, n: u32) -> Self
The identifier of area area, rule number n (counting from 1).
Sourcepub fn parse(s: &str) -> Result<Self, RuleIdError>
pub fn parse(s: &str) -> Result<Self, RuleIdError>
Parse BS-<area>-<n>, refusing an unknown area, a missing or
non-numeric number, and a number that is zero or written with a
leading zero (one spelling per rule).
Trait Implementations§
impl Eq for RuleId
Source§impl Ord for RuleId
impl Ord for RuleId
1.21.0 (const: unstable) · 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 PartialOrd for RuleId
impl PartialOrd for RuleId
impl StructuralPartialEq for RuleId
Auto Trait Implementations§
impl Freeze for RuleId
impl RefUnwindSafe for RuleId
impl Send for RuleId
impl Sync for RuleId
impl Unpin for RuleId
impl UnsafeUnpin for RuleId
impl UnwindSafe for RuleId
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