pub struct ScannerRegistry { /* private fields */ }Expand description
Registry of available scanners.
Maintains a collection of Scanner implementations and routes files
to the appropriate scanner based on extension.
Implementations§
Source§impl ScannerRegistry
impl ScannerRegistry
Sourcepub fn scanner_for(&self, path: &Path) -> Option<&dyn Scanner>
pub fn scanner_for(&self, path: &Path) -> Option<&dyn Scanner>
Finds a scanner that can handle the given file path.
Returns None if no registered scanner handles this file type.
Sourcepub fn all_extensions(&self) -> Vec<&str>
pub fn all_extensions(&self) -> Vec<&str>
Returns all file extensions supported by registered scanners.
Source§impl ScannerRegistry
impl ScannerRegistry
Sourcepub fn for_language(language: &str) -> Self
pub fn for_language(language: &str) -> Self
Creates a registry with only the scanner for a specific language.
Supported languages: “rust”, “python”, “go”, “javascript”, “typescript” If the language is not recognized or empty, returns a registry with all scanners.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScannerRegistry
impl !RefUnwindSafe for ScannerRegistry
impl Send for ScannerRegistry
impl Sync for ScannerRegistry
impl Unpin for ScannerRegistry
impl UnsafeUnpin for ScannerRegistry
impl !UnwindSafe for ScannerRegistry
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