11 releases (7 breaking)

0.8.0 Jun 22, 2022
0.7.2 Mar 22, 2022
0.7.1 Jul 13, 2021
0.6.1 Jan 25, 2021
0.2.0 Nov 23, 2019

#1605 in Network programming

Download history 7998/week @ 2022-10-13 6936/week @ 2022-10-20 6260/week @ 2022-10-27 9428/week @ 2022-11-03 8056/week @ 2022-11-10 5245/week @ 2022-11-17 6191/week @ 2022-11-24 7779/week @ 2022-12-01 6936/week @ 2022-12-08 6453/week @ 2022-12-15 2690/week @ 2022-12-22 3548/week @ 2022-12-29 6817/week @ 2023-01-05 8487/week @ 2023-01-12 10532/week @ 2023-01-19 10857/week @ 2023-01-26

37,783 downloads per month
Used in md-dir-builder

Apache-2.0

185KB
4K 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–9MB
~148K SLoC