Expand description
Rust port of voidtools’ Everything’s IPC SDK. Can be used to search user files quickly on Windows.
§Features
- Support both Everything v1.4 and v1.5, including Alpha version.
- Higher performance than Everything v1.4’s official SDK:
- Hot query time is about 30% shorter.
- Sending blocking time is 60% shorter for async queries.
- Support both sync and async (Tokio) querying.
- Search text generating utilities.
- Folder-based batch IPC and cache.
§APIs
IpcWindow: A minimal IPC interface for Everything v1.4+.wm: Everything’s window message IPC interface, supported by Everything v1.4+.pipe: Everything’s named pipe IPC interface, supported by Everything v1.5+.search: Search text generating utilities.folder: Folder-based batch IPC and cache.
All client types (IpcWindow and EverythingClient) are Send + Sync.
§Examples
// cargo add everything-ipc
use everything_ipc::wm::{EverythingClient, RequestFlags, Sort};
let everything = EverythingClient::new().expect("not available");
let list = everything
.query_wait(r"C:\Windows\ *.exe")
.request_flags(RequestFlags::FileName | RequestFlags::Size | RequestFlags::Path)
.sort(Sort::SizeDescending)
.max_results(5)
.call()
.expect("query");
println!("Found {} items:", list.len());
println!("{:<25} {:>10} {}", "Filename", "Size", "Path");
for item in list.iter() {
// get_string() for String, get_str() for &U16CStr
let filename = item.get_string(RequestFlags::FileName).unwrap();
let path = item.get_str(RequestFlags::Path).unwrap().display();
let size = item.get_size(RequestFlags::Size).unwrap();
println!("{:<25} {:>10} {}", filename, size, path);
}
println!("Total: {} items", list.total_len());
/*
Found 5 items:
Filename Size Path
MRT.exe 223939376 C:\Windows\System32
MRT-KB890830.exe 133315992 C:\Windows\System32
OneDriveSetup.exe 89771848 C:\Windows\WinSxS\amd64_microsoft-windows-onedrive-setup_31bf3856ad364e35_10.0.26100.5074_none_c1340e9ad5f0a5d0
OneDriveSetup.exe 89771848 C:\Windows\System32
OneDriveSetup.exe 60357040 C:\Windows\WinSxS\amd64_microsoft-windows-onedrive-setup_31bf3856ad364e35_10.0.26100.1_none_2233e98c8e9ce5f5
Total: 5742 items
*/§Crate features
-
tokio— Tokio async runtime. Required by async querying and Everything v1.5’spipeIPC interface. -
folder— Folder-based batch IPC and cache. -
pe— PE file utilities. -
drop-join-thread— When droppingwm::EverythingClient, wait for the message thread to exit.By default, [
wm::EverythingClient::drop()] won’t wait for the message thread. This is usually fine, but in some cases you may want to make sure it exited, like before unloading your DLL, you can enable this feature instead.However, this will cause thread-local clients to deadlock on drop.
Modules§
- folder
folder - Folder-based batch IPC and cache.
- pe
pe - PE file utilities.
- pipe
tokio - Everything’s named pipe IPC interface, supported by Everything v1.5+.
- search
- Search text generating utilities.
- wm
- Everything’s window message IPC interface, supported by Everything v1.4+.