pub struct StatementSummary {
pub shape_tag: u8,
pub native_kind: Option<Lexeme>,
pub token_start: usize,
pub token_end: usize,
}Expand description
A statement reduced to its shape and the span of its tokens.
The shape carries the rename-invariant signal that aligns two statement sequences; the span is how the text itself is recovered, for the lexical comparison that decides whether aligned statements are actually copies.
The span is kept rather than the token texts because a compound statement covers its whole body: cloning the texts would cost a copy of the token stream once per level of nesting, while an index pair costs the same whatever the statement contains. It is a position into one file’s stream and nothing more — identity in this tool is content-derived, and no fingerprint reads this type.
Fields§
§shape_tag: u8Shape tag of the statement (see Shape::tag).
native_kind: Option<Lexeme>Native kind name when the statement is a Shape::Native node.
token_start: usizeIndex of the statement’s first token in its file’s stream.
token_end: usizeIndex one past the statement’s last token in its file’s stream.
Implementations§
Trait Implementations§
Source§impl Clone for StatementSummary
impl Clone for StatementSummary
Source§fn clone(&self) -> StatementSummary
fn clone(&self) -> StatementSummary
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 StatementSummary
impl Debug for StatementSummary
impl Eq for StatementSummary
Source§impl PartialEq for StatementSummary
impl PartialEq for StatementSummary
impl StructuralPartialEq for StatementSummary
Auto Trait Implementations§
impl Freeze for StatementSummary
impl RefUnwindSafe for StatementSummary
impl Send for StatementSummary
impl Sync for StatementSummary
impl Unpin for StatementSummary
impl UnsafeUnpin for StatementSummary
impl UnwindSafe for StatementSummary
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.