pub struct PatternHintInput {
pub node_kind: String,
pub text: String,
}Expand description
Input struct for classify_hint — re-exported from sdivi-patterns for WASM embedders.
Contains only the two fields that classify_hint inspects: node_kind and text.
Foreign extractors construct this directly; the native pipeline uses
sdivi_parsing::feature_record::PatternHint and M33 will wire the conversion.
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<PatternHintInput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PatternHintInput, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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.