pub struct RepositoryScanner { /* private fields */ }Expand description
Repository scanner that processes project files and structure.
The scanner walks through the repository directory, identifies relevant files, extracts their content, and gathers project metadata.
§Examples
use ai_context_gen::{Config, RepositoryScanner};
use std::path::PathBuf;
let config = Config {
repo_path: PathBuf::from("."),
max_tokens: 50000,
output_file: "context.md".to_string(),
include_hidden: false,
include_deps: true,
};
let scanner = RepositoryScanner::new(config);
let scan_result = scanner.scan().await?;
println!("Found {} files", scan_result.files.len());Implementations§
Source§impl RepositoryScanner
impl RepositoryScanner
Sourcepub async fn scan(&self) -> Result<ScanResult>
pub async fn scan(&self) -> Result<ScanResult>
Performs a complete scan of the repository.
This method walks through the repository directory structure, processes all supported files, extracts project metadata, and builds a comprehensive scan result.
§Returns
A ScanResult containing all discovered files, project structure, and metadata.
§Errors
Returns an error if:
- The repository path doesn’t exist or isn’t accessible
- File system errors occur during scanning
- Files can’t be read or parsed
§Examples
use ai_context_gen::{Config, RepositoryScanner};
let config = Config::default();
let scanner = RepositoryScanner::new(config);
let result = scanner.scan().await?;
println!("Scanned {} files", result.files.len());
println!("Total size: {} bytes", result.project_structure.total_size);Auto Trait Implementations§
impl Freeze for RepositoryScanner
impl RefUnwindSafe for RepositoryScanner
impl Send for RepositoryScanner
impl Sync for RepositoryScanner
impl Unpin for RepositoryScanner
impl UnwindSafe for RepositoryScanner
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