pub struct FileInfo {Show 13 fields
pub path: PathBuf,
pub relative_path: String,
pub size: u64,
pub modified: Option<SystemTime>,
pub decision: RenderDecision,
pub file_type: FileType,
pub language: Language,
pub content: Option<String>,
pub token_estimate: Option<usize>,
pub line_count: Option<usize>,
pub char_count: Option<usize>,
pub is_binary: bool,
pub git_status: Option<GitStatus>,
}
Expand description
Comprehensive file metadata structure
Fields§
§path: PathBuf
Absolute path to the file on disk
relative_path: String
Path relative to repository root (forward slash separated)
size: u64
File size in bytes
modified: Option<SystemTime>
File modification time
decision: RenderDecision
Analysis decision (include/exclude)
file_type: FileType
Detected file type
language: Language
Detected programming language
content: Option<String>
File content (loaded on demand)
token_estimate: Option<usize>
Estimated token count for LLM processing
line_count: Option<usize>
Line count (if text file)
char_count: Option<usize>
Character count (if text file)
is_binary: bool
Whether the file is likely binary
git_status: Option<GitStatus>
Git status information (if available)
Implementations§
Source§impl FileInfo
impl FileInfo
Sourcepub fn new<P: AsRef<Path>>(
path: P,
relative_path: String,
decision: RenderDecision,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( path: P, relative_path: String, decision: RenderDecision, ) -> Result<Self>
Create a new FileInfo from a path
Sourcepub fn load_content(&mut self) -> Result<()>
pub fn load_content(&mut self) -> Result<()>
Load file content and compute statistics
Sourcepub fn estimate_tokens(content: &str) -> usize
pub fn estimate_tokens(content: &str) -> usize
Estimate token count for LLM processing (rough approximation)
Sourcepub fn detect_binary_by_extension(extension: &str) -> bool
pub fn detect_binary_by_extension(extension: &str) -> bool
Check if file extension indicates binary content
Sourcepub fn classify_file_type(
path: &str,
language: &Language,
extension: &str,
) -> FileType
pub fn classify_file_type( path: &str, language: &Language, extension: &str, ) -> FileType
Classify file type based on path and language
Sourcepub fn human_size(&self) -> String
pub fn human_size(&self) -> String
Get human-readable size
Sourcepub fn should_include(&self) -> bool
pub fn should_include(&self) -> bool
Check if file should be included in analysis
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileInfo
impl<'de> Deserialize<'de> for FileInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FileInfo
impl RefUnwindSafe for FileInfo
impl Send for FileInfo
impl Sync for FileInfo
impl Unpin for FileInfo
impl UnwindSafe for FileInfo
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