Struct FileFactSheet
pub struct FileFactSheet {
pub path: String,
pub sections: Vec<(String, Vec<(String, String)>)>,
}Expand description
A deterministic per-file evidence dossier: ordered sections of pre-formatted facts drawn from the analyses. See the module docs for the determinism contract.
Fields§
§path: StringRepo-relative path the sheet describes.
sections: Vec<(String, Vec<(String, String)>)>Ordered (section, [(key, value)]) facts — already sorted, values
pre-formatted.
Implementations§
§impl FileFactSheet
impl FileFactSheet
pub fn build<R: Repo>(
db: &FactsDb,
repo: &R,
opts: &Options,
path: &str,
) -> Result<Self>
pub fn build<R: Repo>( db: &FactsDb, repo: &R, opts: &Options, path: &str, ) -> Result<Self>
Assemble the fact sheet for path from the analyses, in a fixed order.
The code-health section is mandatory: an error naming the path is returned when the path has no code-health row (it is not a tracked source file, or has too few revisions). The hotspots, functions, cycle, and defect-evidence sections are conditional and are simply omitted when they have no data for the path.
§Errors
Returns CodeLoreError::Analysis when the path has no code-health data,
and propagates any analysis or fact-store error from the feeds.
pub fn to_canonical_text(&self) -> String
pub fn to_canonical_text(&self) -> String
Canonical text: the deterministic cache-key + prompt input.
pub fn to_human_text(&self) -> String
pub fn to_human_text(&self) -> String
Human-readable dossier rendering for explain <path>.
pub fn numeric_values(&self) -> Vec<f64>
pub fn numeric_values(&self) -> Vec<f64>
Every parseable numeric value, for the narrative citation check.
Trait Implementations§
§impl Clone for FileFactSheet
impl Clone for FileFactSheet
§fn clone(&self) -> FileFactSheet
fn clone(&self) -> FileFactSheet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FileFactSheet
impl RefUnwindSafe for FileFactSheet
impl Send for FileFactSheet
impl Sync for FileFactSheet
impl Unpin for FileFactSheet
impl UnsafeUnpin for FileFactSheet
impl UnwindSafe for FileFactSheet
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more