pub struct ScanResult {
pub files: Option<Vec<FileResult>>,
pub files_map: HashMap<PathBuf, Vec<TodoItem>>,
pub summary: Summary,
pub root: Option<PathBuf>,
}Expand description
Result of scanning a directory for TODO items
Fields§
§files: Option<Vec<FileResult>>List of files containing TODO items (for JSON output)
files_map: HashMap<PathBuf, Vec<TodoItem>>Map of file paths to their TODO items (for internal use)
summary: SummarySummary statistics
root: Option<PathBuf>Root directory that was scanned
Implementations§
Source§impl ScanResult
impl ScanResult
Sourcepub fn new(root: PathBuf) -> ScanResult
pub fn new(root: PathBuf) -> ScanResult
Create a new empty scan result
Sourcepub fn from_json(files: Vec<FileResult>, summary: Summary) -> ScanResult
pub fn from_json(files: Vec<FileResult>, summary: Summary) -> ScanResult
Create a scan result from JSON-style data
Sourcepub fn filter_by_tag(&self, tag: &str) -> ScanResult
pub fn filter_by_tag(&self, tag: &str) -> ScanResult
Filter items by tag
Sourcepub fn to_json_format(&self) -> ScanResult
pub fn to_json_format(&self) -> ScanResult
Convert to JSON-friendly format with FileResult list
Sourcepub fn get_files(&self) -> Vec<FileResult>
pub fn get_files(&self) -> Vec<FileResult>
Get files from either format
Trait Implementations§
Source§impl Clone for ScanResult
impl Clone for ScanResult
Source§fn clone(&self) -> ScanResult
fn clone(&self) -> ScanResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScanResult
impl Debug for ScanResult
Source§impl<'de> Deserialize<'de> for ScanResult
impl<'de> Deserialize<'de> for ScanResult
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScanResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScanResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ScanResult
impl Serialize for ScanResult
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ScanResult
impl RefUnwindSafe for ScanResult
impl Send for ScanResult
impl Sync for ScanResult
impl Unpin for ScanResult
impl UnwindSafe for ScanResult
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