pub struct PatternHintInput {
pub node_kind: String,
pub text: String,
}Expand description
A minimal hint struct for callee-text classification.
This is the pure-compute counterpart to sdivi_parsing::feature_record::PatternHint.
It contains only the two fields that crate::queries::classify_hint inspects:
the tree-sitter node_kind and the truncated source text of the node.
Foreign extractors (WASM consumers, Meridian) construct PatternHintInput directly.
The native pipeline uses PatternHint from sdivi-parsing; M33 will add a
conversion when the pipeline is wired to classify_hint.
text is truncated to 256 bytes upstream (per the PatternHint contract).
classify_hint matches only the callee prefix, so truncation never affects
classification correctness.
§Examples
use sdivi_patterns::PatternHintInput;
let hint = PatternHintInput {
node_kind: "call_expression".to_string(),
text: "console.log(\"hello\")".to_string(),
};
assert_eq!(hint.node_kind, "call_expression");Fields§
§node_kind: StringThe tree-sitter node kind (e.g. "call_expression", "macro_invocation").
text: StringSource text of the node, truncated to 256 bytes if the original is longer.
Trait Implementations§
Source§impl Clone for PatternHintInput
impl Clone for PatternHintInput
Source§fn clone(&self) -> PatternHintInput
fn clone(&self) -> PatternHintInput
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 PatternHintInput
impl Debug for PatternHintInput
Source§impl<'de> Deserialize<'de> for PatternHintInput
impl<'de> Deserialize<'de> for PatternHintInput
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>,
Source§impl PartialEq for PatternHintInput
impl PartialEq for PatternHintInput
Source§fn eq(&self, other: &PatternHintInput) -> bool
fn eq(&self, other: &PatternHintInput) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PatternHintInput
impl Serialize for PatternHintInput
impl Eq for PatternHintInput
impl StructuralPartialEq for PatternHintInput
Auto Trait Implementations§
impl Freeze for PatternHintInput
impl RefUnwindSafe for PatternHintInput
impl Send for PatternHintInput
impl Sync for PatternHintInput
impl Unpin for PatternHintInput
impl UnsafeUnpin for PatternHintInput
impl UnwindSafe for PatternHintInput
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.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