pub struct TagRegistry { /* private fields */ }Expand description
Tag registry: holds all valid tags loaded from tags.yaml.
Provides slug-based lookup for validation.
Implementations§
Source§impl TagRegistry
impl TagRegistry
Sourcepub fn load(root: &Path) -> Result<Self, Vec<ParseError>>
pub fn load(root: &Path) -> Result<Self, Vec<ParseError>>
Load a tag registry from {root}/tags.yaml.
Returns an empty registry if the file doesn’t exist.
Sourcepub fn parse(content: &str) -> Result<Self, Vec<ParseError>>
pub fn parse(content: &str) -> Result<Self, Vec<ParseError>>
Parse a tag registry from YAML content.
Sourcepub fn get(&self, slug: &str) -> Option<&Tag>
pub fn get(&self, slug: &str) -> Option<&Tag>
Look up a tag by slug. Returns None if not found.
Sourcepub fn contains(&self, slug: &str) -> bool
pub fn contains(&self, slug: &str) -> bool
Check if a tag slug is valid (exists in the registry).
All tags.
Sourcepub fn category_slugs(&self) -> &[String]
pub fn category_slugs(&self) -> &[String]
All category slugs.
Validate a list of tags against the registry. Returns errors for unknown tags.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TagRegistry
impl RefUnwindSafe for TagRegistry
impl Send for TagRegistry
impl Sync for TagRegistry
impl Unpin for TagRegistry
impl UnsafeUnpin for TagRegistry
impl UnwindSafe for TagRegistry
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> 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