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

#170 in Filesystem

Download history 14796/week @ 2024-04-02 12544/week @ 2024-04-09 13989/week @ 2024-04-16 10585/week @ 2024-04-23 11853/week @ 2024-04-30 11870/week @ 2024-05-07 12895/week @ 2024-05-14 9829/week @ 2024-05-21 10929/week @ 2024-05-28 13012/week @ 2024-06-04 13226/week @ 2024-06-11 15978/week @ 2024-06-18 13786/week @ 2024-06-25 10459/week @ 2024-07-02 10709/week @ 2024-07-09 9374/week @ 2024-07-16

46,528 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–12MB
~110K SLoC