pub trait Extractor {
// Required methods
fn extract<'a>(
&self,
source: &'a str,
) -> Result<Vec<ExtractedScript<'a>>, ExtractorError>;
fn file_extension(&self) -> &'static str;
}Expand description
Trait for framework-specific extractors.
Frameworks can implement this trait to provide script extraction capabilities.
Required Methods§
Sourcefn extract<'a>(
&self,
source: &'a str,
) -> Result<Vec<ExtractedScript<'a>>, ExtractorError>
fn extract<'a>( &self, source: &'a str, ) -> Result<Vec<ExtractedScript<'a>>, ExtractorError>
Sourcefn file_extension(&self) -> &'static str
fn file_extension(&self) -> &'static str
Get the file extension this extractor handles (e.g., “.js”, “.ts”).