pub struct SearchQueryOptions {
Show 14 fields pub allowed_file_types: HashSet<FileType>, pub include: Option<SearchQueryCondition>, pub exclude: Option<SearchQueryCondition>, pub upward: bool, pub follow_symbolic_links: bool, pub limit: Option<u64>, pub max_depth: Option<u64>, pub pagination: Option<u64>, pub ignore_hidden: bool, pub use_ignore_files: bool, pub use_parent_ignore_files: bool, pub use_git_ignore_files: bool, pub use_global_git_ignore_files: bool, pub use_git_exclude_files: bool,
}
Expand description

Options associated with a search query

Fields§

§allowed_file_types: HashSet<FileType>

Restrict search to only these file types (otherwise all are allowed).

§include: Option<SearchQueryCondition>

Regex to use to filter paths being searched to only those that match the include condition.

§exclude: Option<SearchQueryCondition>

Regex to use to filter paths being searched to only those that do not match the exclude. condition

§upward: bool

If true, will search upward through parent directories rather than the traditional downward search that recurses through all children directories.

Note that this will use maximum depth to apply to the reverse direction, and will only look through each ancestor directory’s immediate entries. In other words, this will not result in recursing through sibling directories.

An upward search will ALWAYS search the contents of a directory, so this means providing a path to a directory will search its entries EVEN if the max_depth is 0.

§follow_symbolic_links: bool

Search should follow symbolic links.

§limit: Option<u64>

Maximum results to return before stopping the query.

§max_depth: Option<u64>

Maximum depth (directories) to search

The smallest depth is 0 and always corresponds to the path given to the new function on this type. Its direct descendents have depth 1, and their descendents have depth 2, and so on.

Note that this will not simply filter the entries of the iterator, but it will actually avoid descending into directories when the depth is exceeded.

§pagination: Option<u64>

Amount of results to batch before sending back excluding final submission that will always include the remaining results even if less than pagination request.

§ignore_hidden: bool

If true, will skip searching hidden files.

§use_ignore_files: bool

If true, will read .ignore files that are used by ripgrep and The Silver Searcher to determine which files and directories to not search.

§use_parent_ignore_files: bool

If true, will read .ignore files from parent directories that are used by ripgrep and The Silver Searcher to determine which files and directories to not search.

§use_git_ignore_files: bool

If true, will read .gitignore files to determine which files and directories to not search.

§use_global_git_ignore_files: bool

If true, will read global .gitignore files to determine which files and directories to not search.

§use_git_exclude_files: bool

If true, will read .git/info/exclude files to determine which files and directories to not search.

Trait Implementations§

source§

impl Clone for SearchQueryOptions

source§

fn clone(&self) -> SearchQueryOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SearchQueryOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SearchQueryOptions

source§

fn default() -> SearchQueryOptions

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for SearchQueryOptionswhere SearchQueryOptions: Default,

source§

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 PartialEq<SearchQueryOptions> for SearchQueryOptions

source§

fn eq(&self, other: &SearchQueryOptions) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for SearchQueryOptions

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for SearchQueryOptions

source§

impl StructuralEq for SearchQueryOptions

source§

impl StructuralPartialEq for SearchQueryOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,