Struct distant_protocol::SearchQueryOptions
source · pub struct SearchQueryOptions {
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>,
}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: boolIf 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: boolSearch 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.
Trait Implementations§
source§impl Clone for SearchQueryOptions
impl Clone for SearchQueryOptions
source§fn clone(&self) -> SearchQueryOptions
fn clone(&self) -> SearchQueryOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for SearchQueryOptions
impl Debug for SearchQueryOptions
source§impl Default for SearchQueryOptions
impl Default for SearchQueryOptions
source§fn default() -> SearchQueryOptions
fn default() -> SearchQueryOptions
source§impl<'de> Deserialize<'de> for SearchQueryOptionswhere
SearchQueryOptions: Default,
impl<'de> Deserialize<'de> for SearchQueryOptionswhere SearchQueryOptions: Default,
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<SearchQueryOptions> for SearchQueryOptions
impl PartialEq<SearchQueryOptions> for SearchQueryOptions
source§fn eq(&self, other: &SearchQueryOptions) -> bool
fn eq(&self, other: &SearchQueryOptions) -> bool
self and other values to be equal, and is used
by ==.