pub struct EverythingClient { /* private fields */ }Expand description
Client for communicating with the Everything search engine via IPC.
This client manages a hidden window for receiving query responses and maintains a connection to the Everything application’s IPC interface.
§Thread Safety
The client spawns an internal thread to handle Windows messages. All public methods are thread-safe and can be called from multiple threads.
Implementations§
Source§impl EverythingClient
impl EverythingClient
Sourcepub fn try_new(instance_name: Option<HSTRING>) -> Result<Self>
pub fn try_new(instance_name: Option<HSTRING>) -> Result<Self>
Creates a new Everything IPC client.
§Arguments
instance_name- Optional instance name for connecting to a specific Everything instance. UseNonefor the default instance.
§Errors
Returns an error if:
- The Everything application is not running
- Window creation fails
- The message loop thread fails to start
§Example
use everything_raw::EverythingClient;
let client = EverythingClient::try_new(None)?;Examples found in repository?
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}More examples
4fn main() {
5 println!("Everything Direct IPC Example (No DLL Required)\n");
6 println!("{}", "=".repeat(60));
7
8 let client = EverythingClient::try_new(None).unwrap();
9 // Check if Everything is running and get version
10 let (major, minor, revision, build, target_build) = client.get_build_info();
11 println!(
12 " Build Info: {}.{}.{}.{} (Target Build: {})",
13 major, minor, revision, build, target_build
14 );
15
16 // Check database status
17 if client.is_db_loaded() {
18 println!("✓ Database is loaded");
19 } else {
20 println!("⚠ Database is not loaded yet");
21 }
22
23 if client.is_admin() {
24 println!("✓ Running with administrator privileges");
25 } else {
26 println!(" Running without administrator privileges");
27 }
28
29 println!("\n{}", "=".repeat(60));
30 println!("Query Execution:");
31 println!("{}", "=".repeat(60));
32
33 // Simple query for .pdf files
34 println!("\nSearching for: *.txt (first 10 results)");
35 let result = client
36 .query(&QueryInfo {
37 search: h!("*.txt").clone(),
38 search_flags: bindings::IpcSearchFlags::empty(),
39 request_flags: RequestFlags::all(),
40 sort: bindings::IpcSort::DateAccessedDescending,
41 offset: 0,
42 max_results: 10,
43 })
44 .unwrap();
45 println!(
46 "✓ Found {} results (showing {} items):",
47 result.total_items, result.num_items
48 );
49 for item in result.items {
50 println!("{:?}", item);
51 }
52
53 println!("\n{}", "=".repeat(60));
54
55 let filename = h!("C:\\Windows\\notepad.exe");
56 dbg!(client.get_run_count_from_filename(filename));
57 dbg!(client.inc_run_count_from_filename(filename));
58 dbg!(client.set_run_count_from_filename(filename, 42));
59 dbg!(client.get_run_count_from_filename(filename));
60}Sourcepub fn refresh_ipc_window(&mut self) -> Result<()>
pub fn refresh_ipc_window(&mut self) -> Result<()>
Refreshes the handle to the Everything IPC window.
Call this if Everything was restarted after the client was created.
Sourcepub fn is_ipc_available(&self) -> bool
pub fn is_ipc_available(&self) -> bool
Checks if the Everything IPC window is available.
Sourcepub fn get_major_version(&self) -> u32
pub fn get_major_version(&self) -> u32
Gets the major version number of Everything.
Sourcepub fn get_minor_version(&self) -> u32
pub fn get_minor_version(&self) -> u32
Gets the minor version number of Everything.
Sourcepub fn get_revision(&self) -> u32
pub fn get_revision(&self) -> u32
Gets the revision number of Everything.
Sourcepub fn get_build_number(&self) -> u32
pub fn get_build_number(&self) -> u32
Gets the build number of Everything.
Sourcepub fn get_target_machine(&self) -> TargetMachine
pub fn get_target_machine(&self) -> TargetMachine
Gets the target machine architecture of Everything.
Sourcepub fn get_build_info(&self) -> (u32, u32, u32, u32, TargetMachine)
pub fn get_build_info(&self) -> (u32, u32, u32, u32, TargetMachine)
Gets comprehensive build information from Everything.
Returns a tuple of (major, minor, revision, build, target_machine).
Examples found in repository?
4fn main() {
5 println!("Everything Direct IPC Example (No DLL Required)\n");
6 println!("{}", "=".repeat(60));
7
8 let client = EverythingClient::try_new(None).unwrap();
9 // Check if Everything is running and get version
10 let (major, minor, revision, build, target_build) = client.get_build_info();
11 println!(
12 " Build Info: {}.{}.{}.{} (Target Build: {})",
13 major, minor, revision, build, target_build
14 );
15
16 // Check database status
17 if client.is_db_loaded() {
18 println!("✓ Database is loaded");
19 } else {
20 println!("⚠ Database is not loaded yet");
21 }
22
23 if client.is_admin() {
24 println!("✓ Running with administrator privileges");
25 } else {
26 println!(" Running without administrator privileges");
27 }
28
29 println!("\n{}", "=".repeat(60));
30 println!("Query Execution:");
31 println!("{}", "=".repeat(60));
32
33 // Simple query for .pdf files
34 println!("\nSearching for: *.txt (first 10 results)");
35 let result = client
36 .query(&QueryInfo {
37 search: h!("*.txt").clone(),
38 search_flags: bindings::IpcSearchFlags::empty(),
39 request_flags: RequestFlags::all(),
40 sort: bindings::IpcSort::DateAccessedDescending,
41 offset: 0,
42 max_results: 10,
43 })
44 .unwrap();
45 println!(
46 "✓ Found {} results (showing {} items):",
47 result.total_items, result.num_items
48 );
49 for item in result.items {
50 println!("{:?}", item);
51 }
52
53 println!("\n{}", "=".repeat(60));
54
55 let filename = h!("C:\\Windows\\notepad.exe");
56 dbg!(client.get_run_count_from_filename(filename));
57 dbg!(client.inc_run_count_from_filename(filename));
58 dbg!(client.set_run_count_from_filename(filename, 42));
59 dbg!(client.get_run_count_from_filename(filename));
60}Sourcepub fn is_appdata(&self) -> bool
pub fn is_appdata(&self) -> bool
Returns whether Everything is saving to %APPDATA% or beside the executable.
Availability: Everything 1.4+
Sourcepub fn rebuild_db(&self) -> bool
pub fn rebuild_db(&self) -> bool
Requests Everything to rebuild its database immediately.
Availability: Everything 1.4+
Sourcepub fn queue_rebuild_db(&self) -> bool
pub fn queue_rebuild_db(&self) -> bool
Queues a database rebuild in Everything.
Availability: Everything 1.5+
Sourcepub fn save_db(&self) -> bool
pub fn save_db(&self) -> bool
Requests Everything to save its database to disk.
Availability: Everything 1.4+
Sourcepub fn is_db_loaded(&self) -> bool
pub fn is_db_loaded(&self) -> bool
Checks if the Everything database is loaded.
Availability: Everything 1.4+
Examples found in repository?
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}More examples
4fn main() {
5 println!("Everything Direct IPC Example (No DLL Required)\n");
6 println!("{}", "=".repeat(60));
7
8 let client = EverythingClient::try_new(None).unwrap();
9 // Check if Everything is running and get version
10 let (major, minor, revision, build, target_build) = client.get_build_info();
11 println!(
12 " Build Info: {}.{}.{}.{} (Target Build: {})",
13 major, minor, revision, build, target_build
14 );
15
16 // Check database status
17 if client.is_db_loaded() {
18 println!("✓ Database is loaded");
19 } else {
20 println!("⚠ Database is not loaded yet");
21 }
22
23 if client.is_admin() {
24 println!("✓ Running with administrator privileges");
25 } else {
26 println!(" Running without administrator privileges");
27 }
28
29 println!("\n{}", "=".repeat(60));
30 println!("Query Execution:");
31 println!("{}", "=".repeat(60));
32
33 // Simple query for .pdf files
34 println!("\nSearching for: *.txt (first 10 results)");
35 let result = client
36 .query(&QueryInfo {
37 search: h!("*.txt").clone(),
38 search_flags: bindings::IpcSearchFlags::empty(),
39 request_flags: RequestFlags::all(),
40 sort: bindings::IpcSort::DateAccessedDescending,
41 offset: 0,
42 max_results: 10,
43 })
44 .unwrap();
45 println!(
46 "✓ Found {} results (showing {} items):",
47 result.total_items, result.num_items
48 );
49 for item in result.items {
50 println!("{:?}", item);
51 }
52
53 println!("\n{}", "=".repeat(60));
54
55 let filename = h!("C:\\Windows\\notepad.exe");
56 dbg!(client.get_run_count_from_filename(filename));
57 dbg!(client.inc_run_count_from_filename(filename));
58 dbg!(client.set_run_count_from_filename(filename, 42));
59 dbg!(client.get_run_count_from_filename(filename));
60}Sourcepub fn is_db_busy(&self) -> bool
pub fn is_db_busy(&self) -> bool
Checks whether the Everything database is currently busy.
Availability: Everything 1.4+
Sourcepub fn is_admin(&self) -> bool
pub fn is_admin(&self) -> bool
Checks if Everything is running with administrator privileges.
Availability: Everything 1.4+
Examples found in repository?
4fn main() {
5 println!("Everything Direct IPC Example (No DLL Required)\n");
6 println!("{}", "=".repeat(60));
7
8 let client = EverythingClient::try_new(None).unwrap();
9 // Check if Everything is running and get version
10 let (major, minor, revision, build, target_build) = client.get_build_info();
11 println!(
12 " Build Info: {}.{}.{}.{} (Target Build: {})",
13 major, minor, revision, build, target_build
14 );
15
16 // Check database status
17 if client.is_db_loaded() {
18 println!("✓ Database is loaded");
19 } else {
20 println!("⚠ Database is not loaded yet");
21 }
22
23 if client.is_admin() {
24 println!("✓ Running with administrator privileges");
25 } else {
26 println!(" Running without administrator privileges");
27 }
28
29 println!("\n{}", "=".repeat(60));
30 println!("Query Execution:");
31 println!("{}", "=".repeat(60));
32
33 // Simple query for .pdf files
34 println!("\nSearching for: *.txt (first 10 results)");
35 let result = client
36 .query(&QueryInfo {
37 search: h!("*.txt").clone(),
38 search_flags: bindings::IpcSearchFlags::empty(),
39 request_flags: RequestFlags::all(),
40 sort: bindings::IpcSort::DateAccessedDescending,
41 offset: 0,
42 max_results: 10,
43 })
44 .unwrap();
45 println!(
46 "✓ Found {} results (showing {} items):",
47 result.total_items, result.num_items
48 );
49 for item in result.items {
50 println!("{:?}", item);
51 }
52
53 println!("\n{}", "=".repeat(60));
54
55 let filename = h!("C:\\Windows\\notepad.exe");
56 dbg!(client.get_run_count_from_filename(filename));
57 dbg!(client.inc_run_count_from_filename(filename));
58 dbg!(client.set_run_count_from_filename(filename, 42));
59 dbg!(client.get_run_count_from_filename(filename));
60}Sourcepub fn update_all_folder_indexes(&self) -> bool
pub fn update_all_folder_indexes(&self) -> bool
Requests Everything to update all folder indexes.
Availability: Everything 1.4+
Sourcepub fn save_run_history(&self) -> bool
pub fn save_run_history(&self) -> bool
Requests Everything to save the run history to disk.
Availability: Everything 1.4+
Sourcepub fn delete_run_history(&self) -> bool
pub fn delete_run_history(&self) -> bool
Requests Everything to delete ALL run history.
Availability: Everything 1.4+
Sourcepub fn is_fast_sort(&self) -> bool
pub fn is_fast_sort(&self) -> bool
Checks if fast sorting is enabled in Everything.
Availability: Everything 1.4+
Sourcepub fn is_file_info_indexed(&self, info_ty: FileInfo) -> bool
pub fn is_file_info_indexed(&self, info_ty: FileInfo) -> bool
Sourcepub fn get_run_count_from_filename(&self, filename: impl Param<PCWSTR>) -> u32
pub fn get_run_count_from_filename(&self, filename: impl Param<PCWSTR>) -> u32
Gets the run count for a specific filename.
Examples found in repository?
4fn main() {
5 println!("Everything Direct IPC Example (No DLL Required)\n");
6 println!("{}", "=".repeat(60));
7
8 let client = EverythingClient::try_new(None).unwrap();
9 // Check if Everything is running and get version
10 let (major, minor, revision, build, target_build) = client.get_build_info();
11 println!(
12 " Build Info: {}.{}.{}.{} (Target Build: {})",
13 major, minor, revision, build, target_build
14 );
15
16 // Check database status
17 if client.is_db_loaded() {
18 println!("✓ Database is loaded");
19 } else {
20 println!("⚠ Database is not loaded yet");
21 }
22
23 if client.is_admin() {
24 println!("✓ Running with administrator privileges");
25 } else {
26 println!(" Running without administrator privileges");
27 }
28
29 println!("\n{}", "=".repeat(60));
30 println!("Query Execution:");
31 println!("{}", "=".repeat(60));
32
33 // Simple query for .pdf files
34 println!("\nSearching for: *.txt (first 10 results)");
35 let result = client
36 .query(&QueryInfo {
37 search: h!("*.txt").clone(),
38 search_flags: bindings::IpcSearchFlags::empty(),
39 request_flags: RequestFlags::all(),
40 sort: bindings::IpcSort::DateAccessedDescending,
41 offset: 0,
42 max_results: 10,
43 })
44 .unwrap();
45 println!(
46 "✓ Found {} results (showing {} items):",
47 result.total_items, result.num_items
48 );
49 for item in result.items {
50 println!("{:?}", item);
51 }
52
53 println!("\n{}", "=".repeat(60));
54
55 let filename = h!("C:\\Windows\\notepad.exe");
56 dbg!(client.get_run_count_from_filename(filename));
57 dbg!(client.inc_run_count_from_filename(filename));
58 dbg!(client.set_run_count_from_filename(filename, 42));
59 dbg!(client.get_run_count_from_filename(filename));
60}Sourcepub fn inc_run_count_from_filename(&self, filename: impl Param<PCWSTR>) -> bool
pub fn inc_run_count_from_filename(&self, filename: impl Param<PCWSTR>) -> bool
Increments the run count for a specific filename.
Returns true if the operation was successful.
Examples found in repository?
4fn main() {
5 println!("Everything Direct IPC Example (No DLL Required)\n");
6 println!("{}", "=".repeat(60));
7
8 let client = EverythingClient::try_new(None).unwrap();
9 // Check if Everything is running and get version
10 let (major, minor, revision, build, target_build) = client.get_build_info();
11 println!(
12 " Build Info: {}.{}.{}.{} (Target Build: {})",
13 major, minor, revision, build, target_build
14 );
15
16 // Check database status
17 if client.is_db_loaded() {
18 println!("✓ Database is loaded");
19 } else {
20 println!("⚠ Database is not loaded yet");
21 }
22
23 if client.is_admin() {
24 println!("✓ Running with administrator privileges");
25 } else {
26 println!(" Running without administrator privileges");
27 }
28
29 println!("\n{}", "=".repeat(60));
30 println!("Query Execution:");
31 println!("{}", "=".repeat(60));
32
33 // Simple query for .pdf files
34 println!("\nSearching for: *.txt (first 10 results)");
35 let result = client
36 .query(&QueryInfo {
37 search: h!("*.txt").clone(),
38 search_flags: bindings::IpcSearchFlags::empty(),
39 request_flags: RequestFlags::all(),
40 sort: bindings::IpcSort::DateAccessedDescending,
41 offset: 0,
42 max_results: 10,
43 })
44 .unwrap();
45 println!(
46 "✓ Found {} results (showing {} items):",
47 result.total_items, result.num_items
48 );
49 for item in result.items {
50 println!("{:?}", item);
51 }
52
53 println!("\n{}", "=".repeat(60));
54
55 let filename = h!("C:\\Windows\\notepad.exe");
56 dbg!(client.get_run_count_from_filename(filename));
57 dbg!(client.inc_run_count_from_filename(filename));
58 dbg!(client.set_run_count_from_filename(filename, 42));
59 dbg!(client.get_run_count_from_filename(filename));
60}Sourcepub fn set_run_count_from_filename(
&self,
filename: impl Param<PCWSTR>,
run_count: u32,
) -> bool
pub fn set_run_count_from_filename( &self, filename: impl Param<PCWSTR>, run_count: u32, ) -> bool
Sets the run count for a specific filename.
Returns true if the operation was successful.
Examples found in repository?
4fn main() {
5 println!("Everything Direct IPC Example (No DLL Required)\n");
6 println!("{}", "=".repeat(60));
7
8 let client = EverythingClient::try_new(None).unwrap();
9 // Check if Everything is running and get version
10 let (major, minor, revision, build, target_build) = client.get_build_info();
11 println!(
12 " Build Info: {}.{}.{}.{} (Target Build: {})",
13 major, minor, revision, build, target_build
14 );
15
16 // Check database status
17 if client.is_db_loaded() {
18 println!("✓ Database is loaded");
19 } else {
20 println!("⚠ Database is not loaded yet");
21 }
22
23 if client.is_admin() {
24 println!("✓ Running with administrator privileges");
25 } else {
26 println!(" Running without administrator privileges");
27 }
28
29 println!("\n{}", "=".repeat(60));
30 println!("Query Execution:");
31 println!("{}", "=".repeat(60));
32
33 // Simple query for .pdf files
34 println!("\nSearching for: *.txt (first 10 results)");
35 let result = client
36 .query(&QueryInfo {
37 search: h!("*.txt").clone(),
38 search_flags: bindings::IpcSearchFlags::empty(),
39 request_flags: RequestFlags::all(),
40 sort: bindings::IpcSort::DateAccessedDescending,
41 offset: 0,
42 max_results: 10,
43 })
44 .unwrap();
45 println!(
46 "✓ Found {} results (showing {} items):",
47 result.total_items, result.num_items
48 );
49 for item in result.items {
50 println!("{:?}", item);
51 }
52
53 println!("\n{}", "=".repeat(60));
54
55 let filename = h!("C:\\Windows\\notepad.exe");
56 dbg!(client.get_run_count_from_filename(filename));
57 dbg!(client.inc_run_count_from_filename(filename));
58 dbg!(client.set_run_count_from_filename(filename, 42));
59 dbg!(client.get_run_count_from_filename(filename));
60}Sourcepub fn query(&self, request: &QueryInfo) -> Result<QueryResult>
pub fn query(&self, request: &QueryInfo) -> Result<QueryResult>
Executes a query and waits for the result.
This method sends the query to Everything via IPC and blocks until the result is received. The query is processed asynchronously by the message loop thread.
§Arguments
request- The query parameters including search string, flags, and options
§Returns
Returns a QueryResult containing matching items and metadata.
§Errors
Returns an error if:
- The request could not be sent to Everything
- The internal state locks are poisoned
§Example
use everything_raw::{EverythingClient, QueryInfo, RequestFlags};
let client = EverythingClient::try_new(None)?;
let query = QueryInfo::new("*.pdf")
.request_flag(RequestFlags::NAME | RequestFlags::PATH)
.max_results(10);
let result = client.query(&query)?;Examples found in repository?
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}More examples
4fn main() {
5 println!("Everything Direct IPC Example (No DLL Required)\n");
6 println!("{}", "=".repeat(60));
7
8 let client = EverythingClient::try_new(None).unwrap();
9 // Check if Everything is running and get version
10 let (major, minor, revision, build, target_build) = client.get_build_info();
11 println!(
12 " Build Info: {}.{}.{}.{} (Target Build: {})",
13 major, minor, revision, build, target_build
14 );
15
16 // Check database status
17 if client.is_db_loaded() {
18 println!("✓ Database is loaded");
19 } else {
20 println!("⚠ Database is not loaded yet");
21 }
22
23 if client.is_admin() {
24 println!("✓ Running with administrator privileges");
25 } else {
26 println!(" Running without administrator privileges");
27 }
28
29 println!("\n{}", "=".repeat(60));
30 println!("Query Execution:");
31 println!("{}", "=".repeat(60));
32
33 // Simple query for .pdf files
34 println!("\nSearching for: *.txt (first 10 results)");
35 let result = client
36 .query(&QueryInfo {
37 search: h!("*.txt").clone(),
38 search_flags: bindings::IpcSearchFlags::empty(),
39 request_flags: RequestFlags::all(),
40 sort: bindings::IpcSort::DateAccessedDescending,
41 offset: 0,
42 max_results: 10,
43 })
44 .unwrap();
45 println!(
46 "✓ Found {} results (showing {} items):",
47 result.total_items, result.num_items
48 );
49 for item in result.items {
50 println!("{:?}", item);
51 }
52
53 println!("\n{}", "=".repeat(60));
54
55 let filename = h!("C:\\Windows\\notepad.exe");
56 dbg!(client.get_run_count_from_filename(filename));
57 dbg!(client.inc_run_count_from_filename(filename));
58 dbg!(client.set_run_count_from_filename(filename, 42));
59 dbg!(client.get_run_count_from_filename(filename));
60}