pub struct TemplateDetector { /* private fields */ }Expand description
Advanced template detection engine
Implementations§
Source§impl TemplateDetector
impl TemplateDetector
Sourcepub fn new() -> Result<TemplateDetector, ScribeError>
pub fn new() -> Result<TemplateDetector, ScribeError>
Create a new template detector
Sourcepub fn detect_template(
&mut self,
file_path: &str,
) -> Result<TemplateDetectionResult, ScribeError>
pub fn detect_template( &mut self, file_path: &str, ) -> Result<TemplateDetectionResult, ScribeError>
Detect if a file is a template and get appropriate score boost
Sourcepub fn get_score_boost(&self, file_path: &str) -> Result<f64, ScribeError>
pub fn get_score_boost(&self, file_path: &str) -> Result<f64, ScribeError>
Get template score boost for a file path
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear content cache
Trait Implementations§
Source§impl Debug for TemplateDetector
impl Debug for TemplateDetector
Source§impl Default for TemplateDetector
impl Default for TemplateDetector
Source§fn default() -> TemplateDetector
fn default() -> TemplateDetector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TemplateDetector
impl RefUnwindSafe for TemplateDetector
impl Send for TemplateDetector
impl Sync for TemplateDetector
impl Unpin for TemplateDetector
impl UnwindSafe for TemplateDetector
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