pub struct StructuralIdentity {Show 14 fields
pub language: String,
pub crate_name: Option<String>,
pub module: Option<String>,
pub container: Option<String>,
pub ast_kind: String,
pub symbol: Option<String>,
pub callee: Option<String>,
pub macro_name: Option<String>,
pub lint: Option<String>,
pub receiver_fingerprint: Option<String>,
pub target_fingerprint: Option<String>,
pub normalized_snippet_hash: Option<String>,
pub line_hint: Option<u32>,
pub column_hint: Option<u32>,
}Fields§
§language: String§crate_name: Option<String>§module: Option<String>§container: Option<String>§ast_kind: String§symbol: Option<String>§callee: Option<String>§macro_name: Option<String>§lint: Option<String>§receiver_fingerprint: Option<String>§target_fingerprint: Option<String>§normalized_snippet_hash: Option<String>§line_hint: Option<u32>§column_hint: Option<u32>Implementations§
Source§impl StructuralIdentity
impl StructuralIdentity
pub fn schema_id() -> &'static str
pub fn new(language: impl Into<String>, ast_kind: impl Into<String>) -> Self
Sourcepub fn truncate_in_place(&mut self)
pub fn truncate_in_place(&mut self)
Cap every source-derived string field at MAX_IDENTITY_FIELD_LEN so a
scanned file with a megabyte-long identifier cannot inflate report/receipt
artifacts unboundedly (DoS / noisy-diff surface) (#1919). Applied in place
at the finding-construction choke point before the identity reaches any
artifact. Hashes (e.g. normalized_snippet_hash) are already fixed-width
and excluded.
Sourcepub fn redact_source_text_fields(&mut self)
pub fn redact_source_text_fields(&mut self)
Redact the source-text-bearing identity fields (symbol, callee,
container, module, macro_name, lint) by clearing them, while
preserving the structural anchors (normalized_snippet_hash,
fingerprints, ast_kind, line_hint, column_hint) that matching
relies on. Opt-in for CI artifacts where source-text-derived fields are
an info-leak surface (#1920).
pub fn stable_key(&self) -> String
pub fn stable_key_parts(&self) -> Vec<(&'static str, String)>
Trait Implementations§
Source§impl Clone for StructuralIdentity
impl Clone for StructuralIdentity
Source§fn clone(&self) -> StructuralIdentity
fn clone(&self) -> StructuralIdentity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StructuralIdentity
impl Debug for StructuralIdentity
impl Eq for StructuralIdentity
Source§impl PartialEq for StructuralIdentity
impl PartialEq for StructuralIdentity
impl StructuralPartialEq for StructuralIdentity
Auto Trait Implementations§
impl Freeze for StructuralIdentity
impl RefUnwindSafe for StructuralIdentity
impl Send for StructuralIdentity
impl Sync for StructuralIdentity
impl Unpin for StructuralIdentity
impl UnsafeUnpin for StructuralIdentity
impl UnwindSafe for StructuralIdentity
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