pub struct AstGrepInput {
pub pattern: String,
pub language: String,
pub path: Option<String>,
pub glob: Option<String>,
pub context_before: Option<u32>,
pub context_after: Option<u32>,
pub context_around: Option<u32>,
pub head_limit: Option<usize>,
pub constraints: Option<HashMap<String, String>>,
}Fields§
§pattern: Stringast-grep pattern code.
language: StringLanguage alias understood by ast-grep, e.g. “rs”, “rust”, “ts”, “tsx”, “py”, “js”.
path: Option<String>File or directory to search. Defaults to the coding server workspace root.
glob: Option<String>Optional glob filter, e.g. “**/.rs” or “.{ts,tsx}”.
context_before: Option<u32>Lines before each match.
context_after: Option<u32>Lines after each match.
context_around: Option<u32>Lines before and after each match. Overrides contextBefore/contextAfter.
head_limit: Option<usize>Maximum number of matches to return.
constraints: Option<HashMap<String, String>>Optional regex constraints on metavariable captures.
Key is the metavariable name without $; value is a regex the captured text must match.
Example: {"CRATE": "^crossterm"} with pattern use $CRATE;.
Trait Implementations§
Source§impl Clone for AstGrepInput
impl Clone for AstGrepInput
Source§fn clone(&self) -> AstGrepInput
fn clone(&self) -> AstGrepInput
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 AstGrepInput
impl Debug for AstGrepInput
Source§impl Default for AstGrepInput
impl Default for AstGrepInput
Source§fn default() -> AstGrepInput
fn default() -> AstGrepInput
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AstGrepInput
impl<'de> Deserialize<'de> for AstGrepInput
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for AstGrepInput
impl JsonSchema for AstGrepInput
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for AstGrepInput
impl RefUnwindSafe for AstGrepInput
impl Send for AstGrepInput
impl Sync for AstGrepInput
impl Unpin for AstGrepInput
impl UnsafeUnpin for AstGrepInput
impl UnwindSafe for AstGrepInput
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