1 unstable release

0.1.4 Feb 27, 2021
0.1.3 Feb 25, 2021
0.1.2 Feb 25, 2021
0.1.1 Feb 25, 2021
0.1.0 Feb 25, 2021

#20 in #along

MIT license

77KB
2.5K SLoC

C 2.5K SLoC // 0.0% comments Rust 310 SLoC // 0.0% comments

VoidTools' Everything bindings in Rust

This just wraps the VoidTools' bindings, nothing else.

Example

This example requires widestring package along with everything-sys. This same example can be found from examples directory.

use everything_sys::*;
use widestring::U16CString;

pub fn search(query: &str) {
    unsafe {
        let query_as_wchar = U16CString::from_str(query).unwrap();
        Everything_SetSearchW(query_as_wchar.as_ptr());
        if Everything_QueryW(1) == 1 {
            let res = Everything_GetNumResults();
            for i in 0..res {
                let filename =
                    U16CString::from_ptr_str(Everything_GetResultFileNameW(i)).to_string_lossy();
                let path = U16CString::from_ptr_str(Everything_GetResultPathW(i)).to_string_lossy();
                println!("{} {}", path, filename);
            }
        }
    }
}

pub fn main() {
    search("notepad*")
}

Dependencies

~0–2.1MB
~38K SLoC