pub enum Category {
Show 13 variants
Existence,
Content,
StructuredQuery,
Naming,
TextHygiene,
SecurityUnicodeSanity,
Encoding,
Structure,
PortableMetadata,
UnixMetadata,
GitHygiene,
CrossFile,
PluginTier1,
}Expand description
A rule category (a “family” in the docs). Closed set: adding one is a deliberate edit here plus a title/slug review, not an accidental string.
Variants§
Existence
Content
StructuredQuery
Naming
TextHygiene
SecurityUnicodeSanity
Encoding
Structure
PortableMetadata
UnixMetadata
GitHygiene
CrossFile
PluginTier1
Implementations§
Source§impl Category
impl Category
Sourcepub fn title(self) -> &'static str
pub fn title(self) -> &'static str
The display title, matching the ## heading in docs/rules.md exactly.
Sourcepub fn slug(self) -> &'static str
pub fn slug(self) -> &'static str
The URL slug. Must equal docs_export::slugify(self.title()) (gated).
Sourcepub fn order(self) -> usize
pub fn order(self) -> usize
Zero-based display position (index into Category::ALL).
Exhaustive match on purpose: adding a variant is a compile error here
(as in title/slug), and the order() == ALL index test guards these
indices against a reorder of ALL. No panic path, unlike
ALL.position(..).unwrap().
Sourcepub fn from_title(title: &str) -> Option<Category>
pub fn from_title(title: &str) -> Option<Category>
Parse a category from its display title (the form used on a
**Categories:** line). Case- and surrounding-whitespace-sensitive on
the canonical title.
Trait Implementations§
impl Copy for Category
impl Eq for Category
Source§impl Ord for Category
impl Ord for Category
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 Category
impl PartialOrd for Category
impl StructuralPartialEq for Category
Auto Trait Implementations§
impl Freeze for Category
impl RefUnwindSafe for Category
impl Send for Category
impl Sync for Category
impl Unpin for Category
impl UnsafeUnpin for Category
impl UnwindSafe for Category
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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