pub struct StructuralUnit {Show 14 fields
pub file: usize,
pub kind: UnitKind,
pub range: ByteRange,
pub start_line: u32,
pub end_line: u32,
pub token_start: usize,
pub token_end: usize,
pub name: Option<Lexeme>,
pub boilerplate: Option<Boilerplate>,
pub test_code: bool,
pub test_code_evidence: Option<TestCodeEvidence>,
pub fingerprint: UnitFingerprint,
pub content: FragmentFingerprint,
pub normalized_content: FragmentFingerprint,
}Expand description
One analysed unit, kept so a caller can map a group’s member indices back to
source locations. The index of a unit in StructuralReport::units is the
index grouping refers to.
Fields§
§file: usizeIndex of the file this unit belongs to (into the input slice).
kind: UnitKindWhat kind of unit this is; reporting only.
range: ByteRangeSource bytes the unit covers; reporting only.
start_line: u321-based first line; reporting only, never an identity input.
end_line: u321-based last line; reporting only, never an identity input.
token_start: usizeIndex of the unit’s first token in its file’s stream.
token_end: usizeIndex one past the unit’s last token in its file’s stream.
name: Option<Lexeme>The unit’s declared name, when the frontend recovered one.
boilerplate: Option<Boilerplate>The boilerplate shape the unit matches, when it matches one. Recorded, not acted on: a classified unit is analysed and grouped like any other.
test_code: boolWhether the unit is test code: marked as a test itself, or sitting
inside an item that is. Recorded, not acted on, as boilerplate is.
test_code_evidence: Option<TestCodeEvidence>Why this unit is test code, when it is test code.
Structural analysis initially records marker evidence. A caller that knows the scan’s configured test paths can add path evidence after the analysis, without changing candidate extraction or grouping.
fingerprint: UnitFingerprintThe unit’s raw content fingerprint: its stable grouping key and unit identity.
content: FragmentFingerprintThe unit’s content fingerprint in fragment form, used as its member content id when composing a group fingerprint (a whole-unit clone is a fragment spanning the unit; keeping this as a fragment fingerprint keeps the group id forward-compatible with sub-unit members).
normalized_content: FragmentFingerprintIdentifier-normalized content used only for non-Type-1 group identity. Unit identity remains raw so distinct renamed occurrences never merge.
Trait Implementations§
Source§impl Clone for StructuralUnit
impl Clone for StructuralUnit
Source§fn clone(&self) -> StructuralUnit
fn clone(&self) -> StructuralUnit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StructuralUnit
impl Debug for StructuralUnit
impl Eq for StructuralUnit
Source§impl PartialEq for StructuralUnit
impl PartialEq for StructuralUnit
impl StructuralPartialEq for StructuralUnit
Auto Trait Implementations§
impl Freeze for StructuralUnit
impl RefUnwindSafe for StructuralUnit
impl Send for StructuralUnit
impl Sync for StructuralUnit
impl Unpin for StructuralUnit
impl UnsafeUnpin for StructuralUnit
impl UnwindSafe for StructuralUnit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.