pub struct ExtractorRegistry { /* private fields */ }Expand description
Registry of built-in extractors indexed by name.
When a manifest extractor has no run command, the registry is
consulted for a matching built-in by name.
Implementations§
Source§impl ExtractorRegistry
impl ExtractorRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a registry with all built-in extractors registered.
Sourcepub fn register(&mut self, extractor: Box<dyn BuiltinExtractor>)
pub fn register(&mut self, extractor: Box<dyn BuiltinExtractor>)
Register a built-in extractor.
Sourcepub fn alias(&mut self, alias: &str, target: &str)
pub fn alias(&mut self, alias: &str, target: &str)
Register an alias that resolves to an existing extractor.
Sourcepub fn get(&self, name: &str) -> Option<&dyn BuiltinExtractor>
pub fn get(&self, name: &str) -> Option<&dyn BuiltinExtractor>
Look up a built-in extractor by name.
Sourcepub fn extract_all(&self, source: &str, file: &RelativePath) -> Vec<Annotation>
pub fn extract_all(&self, source: &str, file: &RelativePath) -> Vec<Annotation>
Run all extractors whose file extensions match the given file. Returns the combined annotations from all matching extractors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExtractorRegistry
impl !RefUnwindSafe for ExtractorRegistry
impl Send for ExtractorRegistry
impl Sync for ExtractorRegistry
impl Unpin for ExtractorRegistry
impl UnsafeUnpin for ExtractorRegistry
impl !UnwindSafe for ExtractorRegistry
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> 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