Skip to main content

EverythingClient

Struct EverythingClient 

Source
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

Source

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. Use None for 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?
examples/readme.rs (line 5)
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
Hide additional examples
examples/direct_ipc.rs (line 8)
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}
Source

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.

Source

pub fn is_ipc_available(&self) -> bool

Checks if the Everything IPC window is available.

Source

pub fn get_major_version(&self) -> u32

Gets the major version number of Everything.

Source

pub fn get_minor_version(&self) -> u32

Gets the minor version number of Everything.

Source

pub fn get_revision(&self) -> u32

Gets the revision number of Everything.

Source

pub fn get_build_number(&self) -> u32

Gets the build number of Everything.

Source

pub fn get_target_machine(&self) -> TargetMachine

Gets the target machine architecture of Everything.

Source

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?
examples/direct_ipc.rs (line 10)
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}
Source

pub fn is_appdata(&self) -> bool

Returns whether Everything is saving to %APPDATA% or beside the executable.

Availability: Everything 1.4+

Source

pub fn rebuild_db(&self) -> bool

Requests Everything to rebuild its database immediately.

Availability: Everything 1.4+

Source

pub fn queue_rebuild_db(&self) -> bool

Queues a database rebuild in Everything.

Availability: Everything 1.5+

Source

pub fn save_db(&self) -> bool

Requests Everything to save its database to disk.

Availability: Everything 1.4+

Source

pub fn is_db_loaded(&self) -> bool

Checks if the Everything database is loaded.

Availability: Everything 1.4+

Examples found in repository?
examples/readme.rs (line 8)
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
Hide additional examples
examples/direct_ipc.rs (line 17)
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}
Source

pub fn is_db_busy(&self) -> bool

Checks whether the Everything database is currently busy.

Availability: Everything 1.4+

Source

pub fn is_admin(&self) -> bool

Checks if Everything is running with administrator privileges.

Availability: Everything 1.4+

Examples found in repository?
examples/direct_ipc.rs (line 23)
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}
Source

pub fn update_all_folder_indexes(&self) -> bool

Requests Everything to update all folder indexes.

Availability: Everything 1.4+

Source

pub fn save_run_history(&self) -> bool

Requests Everything to save the run history to disk.

Availability: Everything 1.4+

Source

pub fn delete_run_history(&self) -> bool

Requests Everything to delete ALL run history.

Availability: Everything 1.4+

Source

pub fn is_fast_sort(&self) -> bool

Checks if fast sorting is enabled in Everything.

Availability: Everything 1.4+

Source

pub fn is_file_info_indexed(&self, info_ty: FileInfo) -> bool

Checks if a specific file information type is indexed by Everything.

§Arguments
  • info_ty - The type of file information to check (size, dates, attributes, etc.)
§Availability

Everything 1.4+

Source

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?
examples/direct_ipc.rs (line 56)
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}
Source

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?
examples/direct_ipc.rs (line 57)
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}
Source

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?
examples/direct_ipc.rs (line 58)
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}
Source

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?
examples/readme.rs (line 18)
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
Hide additional examples
examples/direct_ipc.rs (lines 36-43)
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}

Trait Implementations§

Source§

impl Drop for EverythingClient

Source§

fn drop(&mut self)

Cleanup: sends WM_QUIT to the message loop thread and destroys the client window.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.