pub struct RepoSubstrate {
pub repo_root: String,
pub files: Vec<SubstrateFile>,
pub lang_summary: BTreeMap<String, LangSummary>,
pub diff_range: Option<DiffRange>,
pub total_tokens: usize,
pub total_bytes: usize,
pub total_code_lines: usize,
}Expand description
Shared context for a scanned repository.
Built once from a tokei scan (and optionally git diff), then passed to every sensor that needs file-level context.
Fields§
§repo_root: StringNormalized repo root path (forward slashes).
files: Vec<SubstrateFile>All scanned files, sorted by path.
lang_summary: BTreeMap<String, LangSummary>Per-language aggregates.
diff_range: Option<DiffRange>Git diff context (if available).
total_tokens: usizeTotal estimated tokens across all files.
total_bytes: usizeTotal bytes across all files.
total_code_lines: usizeTotal lines of code across all files.
Implementations§
Source§impl RepoSubstrate
impl RepoSubstrate
Sourcepub fn diff_files(&self) -> impl Iterator<Item = &SubstrateFile>
pub fn diff_files(&self) -> impl Iterator<Item = &SubstrateFile>
Get files modified in the current diff range.
Sourcepub fn files_for_lang(&self, lang: &str) -> impl Iterator<Item = &SubstrateFile>
pub fn files_for_lang(&self, lang: &str) -> impl Iterator<Item = &SubstrateFile>
Get files for a specific language.
Trait Implementations§
Source§impl Clone for RepoSubstrate
impl Clone for RepoSubstrate
Source§fn clone(&self) -> RepoSubstrate
fn clone(&self) -> RepoSubstrate
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 RepoSubstrate
impl Debug for RepoSubstrate
Source§impl<'de> Deserialize<'de> for RepoSubstrate
impl<'de> Deserialize<'de> for RepoSubstrate
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 RepoSubstrate
impl RefUnwindSafe for RepoSubstrate
impl Send for RepoSubstrate
impl Sync for RepoSubstrate
impl Unpin for RepoSubstrate
impl UnsafeUnpin for RepoSubstrate
impl UnwindSafe for RepoSubstrate
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