pub struct LanguageDetector { /* private fields */ }
Expand description
High-performance language detector with multiple strategies
Implementations§
Source§impl LanguageDetector
impl LanguageDetector
Sourcepub fn with_strategy(strategy: DetectionStrategy) -> Self
pub fn with_strategy(strategy: DetectionStrategy) -> Self
Create a language detector with custom strategy
Sourcepub fn detect_language(&self, path: &Path) -> Language
pub fn detect_language(&self, path: &Path) -> Language
Detect language for a file path (extension-based)
Sourcepub fn detect_language_with_content(
&mut self,
path: &Path,
content: &str,
) -> DetectionResult
pub fn detect_language_with_content( &mut self, path: &Path, content: &str, ) -> DetectionResult
Detect language with full content analysis
Sourcepub fn detect_with_hints(
&mut self,
path: &Path,
content: &str,
hints: &LanguageHints,
) -> DetectionResult
pub fn detect_with_hints( &mut self, path: &Path, content: &str, hints: &LanguageHints, ) -> DetectionResult
Detect language with project context hints
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LanguageDetector
impl RefUnwindSafe for LanguageDetector
impl Send for LanguageDetector
impl Sync for LanguageDetector
impl Unpin for LanguageDetector
impl UnwindSafe for LanguageDetector
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