12 releases (breaking)

0.9.0 Jun 18, 2024
0.8.0 Jun 22, 2022
0.7.2 Mar 22, 2022
0.7.1 Jul 13, 2021
0.2.0 Nov 23, 2019

#186 in Filesystem

Download history 11851/week @ 2024-07-28 11619/week @ 2024-08-04 11009/week @ 2024-08-11 10722/week @ 2024-08-18 10038/week @ 2024-08-25 10325/week @ 2024-09-01 10477/week @ 2024-09-08 14804/week @ 2024-09-15 12150/week @ 2024-09-22 15833/week @ 2024-09-29 12266/week @ 2024-10-06 10178/week @ 2024-10-13 9379/week @ 2024-10-20 9581/week @ 2024-10-27 11804/week @ 2024-11-03 16969/week @ 2024-11-10

48,492 downloads per month
Used in 5 crates (4 directly)

MIT license

200KB
4.5K SLoC

This crate provides a client to the watchman file watching service.

Start with the Connector struct and use it to connect and return a Client struct, Client::resolve_root to resolve a path and initiate a watch, and then Client::query to perform a query, or Client::subscribe to subscribe to file changes in real time.

This example shows how to connect and expand a glob from the current working directory:

use watchman_client::prelude::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = Connector::new().connect().await?;
    let resolved = client
        .resolve_root(CanonicalPath::canonicalize(".")?)
        .await?;

    // Basic globs -> names
    let files = client.glob(&resolved, &["**/*.rs"]).await?;
    println!("files: {:#?}", files);
    Ok(())
}

Dependencies

~4–11MB
~109K SLoC