pub struct QueryInfo {
pub search: HSTRING,
pub search_flags: SearchFlags,
pub request_flags: RequestFlags,
pub sort: SortType,
pub offset: u32,
pub max_results: u32,
}Expand description
Query information for searching with Everything.
Contains all parameters needed to perform a search, including search string, flags, sorting, and pagination options.
Fields§
§search: HSTRINGThe search query string.
search_flags: SearchFlagsSearch behavior flags (case-sensitive, regex, etc.).
request_flags: RequestFlagsWhich fields to include in results (name, path, size, etc.).
sort: SortTypeHow to sort the results.
offset: u32Number of results to skip (for pagination).
max_results: u32Maximum number of results to return.
Implementations§
Source§impl QueryInfo
impl QueryInfo
Sourcepub fn new(search: impl Into<HSTRING>) -> Self
pub fn new(search: impl Into<HSTRING>) -> Self
Creates a new query with the given search string.
Default settings: 50 max results, no special flags, default sorting.
Examples found in repository?
examples/readme.rs (line 14)
3fn main() -> windows::core::Result<()> {
4 // Connect to Everything
5 let client = EverythingClient::try_new(None)?;
6
7 // Check if database is ready
8 if !client.is_db_loaded() {
9 println!("Everything database is still loading...");
10 return Ok(());
11 }
12
13 // Search for PDF files
14 let query = QueryInfo::new("*.pdf")
15 .request_flag(RequestFlags::NAME | RequestFlags::PATH | RequestFlags::SIZE)
16 .max_results(10);
17
18 let results = client.query(&query)?;
19
20 println!("Found {} total results", results.total_items);
21 for item in results.items {
22 println!("{:?} - {:?} ({:?} bytes)",
23 item.name, item.path, item.size);
24 }
25
26 Ok(())
27}Sourcepub fn search_flag(self, flag: SearchFlags) -> Self
pub fn search_flag(self, flag: SearchFlags) -> Self
Adds a search flag (e.g., case-sensitive, regex).
Sourcepub fn request_flag(self, flag: RequestFlags) -> Self
pub fn request_flag(self, flag: RequestFlags) -> Self
Adds a request flag to specify which fields to include in results.
Examples found in repository?
examples/readme.rs (line 15)
3fn main() -> windows::core::Result<()> {
4 // Connect to Everything
5 let client = EverythingClient::try_new(None)?;
6
7 // Check if database is ready
8 if !client.is_db_loaded() {
9 println!("Everything database is still loading...");
10 return Ok(());
11 }
12
13 // Search for PDF files
14 let query = QueryInfo::new("*.pdf")
15 .request_flag(RequestFlags::NAME | RequestFlags::PATH | RequestFlags::SIZE)
16 .max_results(10);
17
18 let results = client.query(&query)?;
19
20 println!("Found {} total results", results.total_items);
21 for item in results.items {
22 println!("{:?} - {:?} ({:?} bytes)",
23 item.name, item.path, item.size);
24 }
25
26 Ok(())
27}Sourcepub fn max_results(self, max_results: u32) -> Self
pub fn max_results(self, max_results: u32) -> Self
Sets the maximum number of results to return.
Examples found in repository?
examples/readme.rs (line 16)
3fn main() -> windows::core::Result<()> {
4 // Connect to Everything
5 let client = EverythingClient::try_new(None)?;
6
7 // Check if database is ready
8 if !client.is_db_loaded() {
9 println!("Everything database is still loading...");
10 return Ok(());
11 }
12
13 // Search for PDF files
14 let query = QueryInfo::new("*.pdf")
15 .request_flag(RequestFlags::NAME | RequestFlags::PATH | RequestFlags::SIZE)
16 .max_results(10);
17
18 let results = client.query(&query)?;
19
20 println!("Found {} total results", results.total_items);
21 for item in results.items {
22 println!("{:?} - {:?} ({:?} bytes)",
23 item.name, item.path, item.size);
24 }
25
26 Ok(())
27}Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryInfo
impl RefUnwindSafe for QueryInfo
impl Send for QueryInfo
impl Sync for QueryInfo
impl Unpin for QueryInfo
impl UnsafeUnpin for QueryInfo
impl UnwindSafe for QueryInfo
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