pub struct FrameworkDetector;Expand description
Framework detector for identifying web frameworks used in a Rust project.
The FrameworkDetector analyzes parsed Rust files to automatically detect which
web frameworks are being used. It does this by examining use statements for
framework-specific imports.
Currently supports detection of:
- Axum (via
use axum::...) - Actix-Web (via
use actix_web::...)
Implementations§
Source§impl FrameworkDetector
impl FrameworkDetector
Sourcepub fn detect(parsed_files: &[ParsedFile]) -> DetectionResult
pub fn detect(parsed_files: &[ParsedFile]) -> DetectionResult
Detects web frameworks used in the provided parsed files.
This method scans all use statements in the parsed files to identify
framework imports. Multiple frameworks can be detected if the project
uses more than one.
§Arguments
parsed_files- Slice of successfully parsed Rust files to analyze
§Returns
Returns a DetectionResult containing all detected frameworks.
§Example
use openapi_from_source::detector::FrameworkDetector;
use openapi_from_source::parser::AstParser;
use std::path::Path;
let parsed = AstParser::parse_file(Path::new("src/main.rs")).unwrap();
let result = FrameworkDetector::detect(&[parsed]);
println!("Detected {} framework(s)", result.frameworks.len());Auto Trait Implementations§
impl Freeze for FrameworkDetector
impl RefUnwindSafe for FrameworkDetector
impl Send for FrameworkDetector
impl Sync for FrameworkDetector
impl Unpin for FrameworkDetector
impl UnwindSafe for FrameworkDetector
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