pub struct EntityRegistry { /* private fields */ }Expand description
Entity registry: holds all shared entities loaded from people/ and
organizations/ directories. Provides name-based lookup for cross-file
resolution.
Implementations§
Source§impl EntityRegistry
impl EntityRegistry
Sourcepub fn load(root: &Path) -> Result<Self, Vec<ParseError>>
pub fn load(root: &Path) -> Result<Self, Vec<ParseError>>
Build a registry from a content root directory.
Scans {root}/people/**/*.md and {root}/organizations/**/*.md, parses
each file, validates for duplicates and filename mismatches. Supports both
flat and nested (country-based) directory layouts.
Sourcepub fn from_entries(
entries: Vec<RegistryEntry>,
) -> Result<Self, Vec<ParseError>>
pub fn from_entries( entries: Vec<RegistryEntry>, ) -> Result<Self, Vec<ParseError>>
Build a registry from pre-parsed entries.
Sourcepub fn get_by_name(&self, name: &str) -> Option<&RegistryEntry>
pub fn get_by_name(&self, name: &str) -> Option<&RegistryEntry>
Look up an entity by name. Returns None if not found.
Sourcepub fn entries(&self) -> &[RegistryEntry]
pub fn entries(&self) -> &[RegistryEntry]
All registry entries.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EntityRegistry
impl RefUnwindSafe for EntityRegistry
impl Send for EntityRegistry
impl Sync for EntityRegistry
impl Unpin for EntityRegistry
impl UnsafeUnpin for EntityRegistry
impl UnwindSafe for EntityRegistry
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