Trait ResolvedPattern

Source
pub trait ResolvedPattern<'a, Q: QueryContext>:
    Clone
    + Debug
    + PartialEq {
Show 43 methods // Required methods fn from_binding(binding: Q::Binding<'a>) -> Self; fn from_constant(constant: Constant) -> Self; fn from_file_pointer(file: FilePtr) -> Self; fn from_files(files: Self) -> Self; fn from_list_parts(parts: impl Iterator<Item = Self>) -> Self; fn from_string(string: String) -> Self; fn from_resolved_snippet(snippet: ResolvedSnippet<'a, Q>) -> Self; fn from_dynamic_snippet( snippet: &'a DynamicSnippet, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>; fn from_dynamic_pattern( pattern: &'a DynamicPattern<Q>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>; fn from_accessor( accessor: &'a Accessor<Q>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>; fn from_list_index( index: &'a ListIndex<Q>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>; fn from_pattern( pattern: &'a Pattern<Q>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>; fn extend( &mut self, with: Q::ResolvedPattern<'a>, effects: &mut Vec<Effect<'a, Q>>, language: &Q::Language<'a>, ) -> GritResult<()>; fn float( &self, state: &FileRegistry<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<f64>; fn get_bindings(&self) -> Option<impl Iterator<Item = Q::Binding<'a>>>; fn get_file(&self) -> Option<&Q::File<'a>>; fn get_file_pointers(&self) -> Option<Vec<FilePtr>>; fn get_files(&self) -> Option<&Self>; fn get_last_binding(&self) -> Option<&Q::Binding<'a>>; fn get_list_item_at(&self, index: isize) -> Option<&Self>; fn get_list_item_at_mut(&mut self, index: isize) -> Option<&mut Self>; fn get_list_items(&self) -> Option<impl Iterator<Item = &Self>>; fn get_list_binding_items( &self, ) -> Option<impl Iterator<Item = Self> + Clone>; fn get_map(&self) -> Option<&BTreeMap<String, Self>>; fn get_map_mut(&mut self) -> Option<&mut BTreeMap<String, Self>>; fn get_snippets( &self, ) -> Option<impl Iterator<Item = ResolvedSnippet<'a, Q>>>; fn is_binding(&self) -> bool; fn is_list(&self) -> bool; fn is_truthy( &self, state: &mut State<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<bool>; fn linearized_text( &self, language: &Q::Language<'a>, effects: &[Effect<'a, Q>], files: &FileRegistry<'a, Q>, memo: &mut HashMap<CodeRange, Option<String>>, should_pad_snippet: bool, logs: &mut AnalysisLogs, ) -> GritResult<Cow<'a, str>>; fn matches_undefined(&self) -> bool; fn matches_false_or_undefined(&self) -> bool; fn normalize_insert( &mut self, binding: &Q::Binding<'a>, is_first: bool, language: &Q::Language<'a>, ) -> GritResult<()>; fn position(&self, language: &Q::Language<'a>) -> Option<Range>; fn push_binding(&mut self, binding: Q::Binding<'a>) -> GritResult<()>; fn set_list_item_at_mut( &mut self, index: isize, value: Self, ) -> GritResult<bool>; fn text( &self, state: &FileRegistry<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<Cow<'a, str>>; // Provided methods fn from_constant_binding(constant: &'a Constant) -> Self { ... } fn from_node_binding(node: Q::Node<'a>) -> Self { ... } fn from_path_binding(path: &'a Path) -> Self { ... } fn from_range_binding(range: ByteRange, src: &'a str) -> Self { ... } fn from_patterns( patterns: &'a [Option<Pattern<Q>>], state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Vec<Option<Self>>> { ... } fn undefined() -> Self { ... }
}

Required Methods§

Source

fn from_binding(binding: Q::Binding<'a>) -> Self

Source

fn from_constant(constant: Constant) -> Self

Source

fn from_file_pointer(file: FilePtr) -> Self

Source

fn from_files(files: Self) -> Self

Source

fn from_list_parts(parts: impl Iterator<Item = Self>) -> Self

Source

fn from_string(string: String) -> Self

Source

fn from_resolved_snippet(snippet: ResolvedSnippet<'a, Q>) -> Self

Source

fn from_dynamic_snippet( snippet: &'a DynamicSnippet, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>

Source

fn from_dynamic_pattern( pattern: &'a DynamicPattern<Q>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>

Source

fn from_accessor( accessor: &'a Accessor<Q>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>

Source

fn from_list_index( index: &'a ListIndex<Q>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>

Source

fn from_pattern( pattern: &'a Pattern<Q>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Self>

Source

fn extend( &mut self, with: Q::ResolvedPattern<'a>, effects: &mut Vec<Effect<'a, Q>>, language: &Q::Language<'a>, ) -> GritResult<()>

Source

fn float( &self, state: &FileRegistry<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<f64>

Source

fn get_bindings(&self) -> Option<impl Iterator<Item = Q::Binding<'a>>>

Source

fn get_file(&self) -> Option<&Q::File<'a>>

Source

fn get_file_pointers(&self) -> Option<Vec<FilePtr>>

Source

fn get_files(&self) -> Option<&Self>

Source

fn get_last_binding(&self) -> Option<&Q::Binding<'a>>

Source

fn get_list_item_at(&self, index: isize) -> Option<&Self>

Source

fn get_list_item_at_mut(&mut self, index: isize) -> Option<&mut Self>

Source

fn get_list_items(&self) -> Option<impl Iterator<Item = &Self>>

Source

fn get_list_binding_items(&self) -> Option<impl Iterator<Item = Self> + Clone>

Source

fn get_map(&self) -> Option<&BTreeMap<String, Self>>

Source

fn get_map_mut(&mut self) -> Option<&mut BTreeMap<String, Self>>

Source

fn get_snippets(&self) -> Option<impl Iterator<Item = ResolvedSnippet<'a, Q>>>

Source

fn is_binding(&self) -> bool

Source

fn is_list(&self) -> bool

Source

fn is_truthy( &self, state: &mut State<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<bool>

Source

fn linearized_text( &self, language: &Q::Language<'a>, effects: &[Effect<'a, Q>], files: &FileRegistry<'a, Q>, memo: &mut HashMap<CodeRange, Option<String>>, should_pad_snippet: bool, logs: &mut AnalysisLogs, ) -> GritResult<Cow<'a, str>>

Source

fn matches_undefined(&self) -> bool

Source

fn matches_false_or_undefined(&self) -> bool

Source

fn normalize_insert( &mut self, binding: &Q::Binding<'a>, is_first: bool, language: &Q::Language<'a>, ) -> GritResult<()>

Source

fn position(&self, language: &Q::Language<'a>) -> Option<Range>

Source

fn push_binding(&mut self, binding: Q::Binding<'a>) -> GritResult<()>

Source

fn set_list_item_at_mut( &mut self, index: isize, value: Self, ) -> GritResult<bool>

Source

fn text( &self, state: &FileRegistry<'a, Q>, language: &Q::Language<'a>, ) -> GritResult<Cow<'a, str>>

Provided Methods§

Source

fn from_constant_binding(constant: &'a Constant) -> Self

Source

fn from_node_binding(node: Q::Node<'a>) -> Self

Source

fn from_path_binding(path: &'a Path) -> Self

Source

fn from_range_binding(range: ByteRange, src: &'a str) -> Self

Source

fn from_patterns( patterns: &'a [Option<Pattern<Q>>], state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<Vec<Option<Self>>>

Source

fn undefined() -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§