Crate everything_rs
source ·Expand description
Everything
This crate provides a safe wrapper around the everything-sys-bindgen
.
everything-sys-bindgen
is a rust binding to the Everything SDK that allow IPC communication to the everything service.
The Everything service indexes files on windows and provides a expressive query syntax to search for files.
See the Everything SDK documentation for more information.
Example
use everything_rs::{Everything, EverythingRequestFlags, EverythingSort, EverythingError};
fn main() -> Result<(), EverythingError> {
let mut everything = Everything::new();
everything.set_search("test");
everything.set_request_flags(
EverythingRequestFlags::FullPathAndFileName
| EverythingRequestFlags::Size
| EverythingRequestFlags::DateCreated
);
everything.set_sort(EverythingSort::DateCreatedDescending);
everything.query()?;
let num_results = everything.get_num_results();
assert!(num_results > 0);
for (i, path) in everything.full_path_iter().flatten().enumerate() {
let size = everything.get_result_size(i as u32)?;
let date_created = everything.get_result_created_date(i as u32)?;
println!("{}: {} {} {}", i, path, size, date_created);
}
Ok(())
}
Structs
- A wrapper around the Everything API.
Calls cleanup on drop. - Input to the Everything.set_request_flags() function. Defines what file information is loaded into memory by everything when query is called. See https://www.voidtools.com/support/everything/sdk/everything_getrequestflags/ for more information.
Enums
- Represents errors that can occur when using the Everything SDK and that will be returned by Everything.get_last_error().
See https://www.voidtools.com/support/everything/sdk/everything_getlasterror/
Note that there is no documentation for EVERYTHING_ERROR_INVALIDREQUEST or EVERYTHING_ERROR_INVALIDPARAMETER - Types of sorting that everything can supports.
See https://www.voidtools.com/support/everything/sdk/everything_setsort/