pub struct FixtureRegistry { /* private fields */ }Expand description
Loaded registry.
Implementations§
Source§impl FixtureRegistry
impl FixtureRegistry
Sourcepub fn load(path: &Path) -> Result<Self, RegistryError>
pub fn load(path: &Path) -> Result<Self, RegistryError>
Load a registry file. Auto-detects format by extension:
.json→ parsed as JSON.ts/.tsx→ lightweight TypeScriptexport const FIXTURES = { ... }extractor (no swc / oxc dep — handles the common documented shape)- anything else → try JSON first, then TS extractor as fallback
pub fn get(&self, id: &str) -> Option<&FixtureDecl>
pub fn require(&self, id: &str) -> Result<&FixtureDecl, RegistryError>
pub fn ids(&self) -> impl Iterator<Item = &String>
Sourcepub fn from_map(fixtures: BTreeMap<String, FixtureDecl>) -> Self
pub fn from_map(fixtures: BTreeMap<String, FixtureDecl>) -> Self
Construct from an in-memory map. Test / library use — the CLI
always goes through Self::load.
Trait Implementations§
Source§impl Clone for FixtureRegistry
impl Clone for FixtureRegistry
Source§fn clone(&self) -> FixtureRegistry
fn clone(&self) -> FixtureRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FixtureRegistry
impl RefUnwindSafe for FixtureRegistry
impl Send for FixtureRegistry
impl Sync for FixtureRegistry
impl Unpin for FixtureRegistry
impl UnsafeUnpin for FixtureRegistry
impl UnwindSafe for FixtureRegistry
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