Stream-based FSEvents API bindings.

Overview

fsevent-stream

GitHub Workflow Status crates.io Documentation

Stream-based FSEvents API bindings.

Features

  • Support directory-granular and file-granular events.
  • Retrieve related file inode with kFSEventStreamCreateFlagUseExtendedData.

Example

use std::path::Path;
use std::time::Duration;

use fsevent_stream::ffi::{
    kFSEventStreamCreateFlagFileEvents, kFSEventStreamCreateFlagNoDefer,
    kFSEventStreamCreateFlagUseCFTypes, kFSEventStreamCreateFlagUseExtendedData,
    kFSEventStreamEventIdSinceNow,
};
use fsevent_stream::stream::create_event_stream;
use futures_util::StreamExt;

let (stream, handler) = create_event_stream(
    [Path::new(".")],
    kFSEventStreamEventIdSinceNow,
    Duration::ZERO,
    kFSEventStreamCreateFlagNoDefer
        | kFSEventStreamCreateFlagFileEvents
        | kFSEventStreamCreateFlagUseExtendedData
        | kFSEventStreamCreateFlagUseCFTypes,
)
    .expect("stream to be created");

let mut stream = stream.into_flatten();
while let Some(event) = stream.next().await {
    println!(
        "[{}] path: {:?}({}), flags: {} ({:x})",
        event.id,
        event.path,
        event.inode.unwrap_or(-1),
        event.flags,
        event.raw_flags
    );
}

Runtime Support

Both tokio and async-std are supported via feature flags.

tokio support is enabled by default. To enable async-std support, disable default features and enable async-std feature.

Acknowledgement

Some code in this project is adapted from the following projects:

License

This project is licensed under MIT License.

FOSSA Status

Comments
Owner
LightQuantum
CS undergraduate @SJTU-19
LightQuantum
Adaptors from AsyncRead/AsyncWrite to Stream/Sink using futures.

async-codec-lite Adaptors from AsyncRead/AsyncWrite to Stream/Sink using futures. async-codec-lite Adaptors from AsyncRead/AsyncWrite to Stream/Sink u

Darin Morrison 1 Dec 3, 2022
Alternative StreamMap fork of tokio-stream

streammap-ext This is a fork of StreamMap from tokio-stream crate. The only difference between the implementations is that this version of StreamMap n

MetalBear 5 Aug 18, 2022
Rust Stream::buffer_unordered where each future can have a different weight.

buffer-unordered-weighted buffer_unordered_weighted is a variant of buffer_unordered, where each future can be assigned a different weight. This crate

null 15 Dec 28, 2022
A lending version of the `Stream` trait

lending-stream A lending version of Stream API Docs | Releases | Contributing Installation $ cargo add lending-stream Safety This crate uses #![deny(u

Yosh 5 Aug 14, 2023
Bindings to the Tauri API for projects using wasm-bindgen

tauri-sys Raw bindings to the Tauri API for projects using wasm-bindgen Installation This crate is not yet published to crates.io, so you need to use

Jonas Kruckenberg 25 Jan 9, 2023
BlueR - Official BlueZ Bindings for Rust

This library provides the official Rust interface to the Linux Bluetooth protocol stack (BlueZ). Both publishing local and consuming remote GATT services using idiomatic Rust code is supported. L2CAP sockets are presented using an API similar to Tokio networking.

BlueZ 121 Dec 26, 2022
Arkworks bindings to Circom's R1CS, for Groth16 Proof and Witness generation in Rust.

ark-circom Arkworks bindings to Circom's R1CS, for Groth16 Proof and Witness generation in Rust.

Georgios Konstantopoulos 138 Dec 25, 2022
Rust language bindings for Bitcoin secp256k1 library.

Full documentation rust-secp256k1 rust-secp256k1 is a wrapper around libsecp256k1, a C library by Pieter Wuille for producing ECDSA signatures using t

Rust Bitcoin Community 250 Dec 18, 2022
Generate bindings to use Rust code in Qt and QML

Rust Qt Binding Generator This code generator gets you started quickly to use Rust code from Qt and QML. In other words, it helps to create a Qt based

KDE GitHub Mirror 768 Dec 24, 2022
Node.js bindings for feed_rs

Description Node.js bindings for feed_rs. Installation npm install @nooptoday/feed-rs Usage import { parse } from '@nooptoday/feed-rs' const response

null 5 Nov 17, 2023
A simple omegle API written in Rust

omegalul-rs omegalul-rs is a work-in-progress opensource library for building Omegle clients. Features Current Features Fetching random server from om

NV6 5 Jun 21, 2022
Simple fake AWS Cognito User Pool API server for development.

Fakey Cognito ?? Homepage Simple fake AWS Cognito API server for development. ✅ Implemented features AdminXxx on User Pools API. Get Started # run wit

naokirin 4 Aug 30, 2022
High level rust abstractions for the libretro API

libretro-rs Design Philosophy The approach to this crate can best be summarized as wanting to expose all functionality, even if not idiomatically. The

null 9 Dec 25, 2022
Femtorinth is a library to interact with a sub-set of the Modrinth API.

Femtorinth Femtorinth is a rust library to interact with a sub-set of the Modrinth api, it only includes the api calls that don't need auth (a.k.a onl

null 2 May 6, 2022
Rust library for interacting with the VTube Studio API

vtubestudio-rs A library for interacting with the VTube Studio API. Basic usage This example creates a Client using the provided builder, which: conne

null 6 Dec 4, 2022
C API to SpringQL (for embedded mode)

SpringQL C Client This repository is a C client for SpringQL and provides it provides: springql.h: C header file. libspringql_client.{so,dylib}: Share

SpringQL 4 Jun 8, 2022
⚡️ Fast MagicString port driven by Rust and N-API

magic-string-rs 100% API compatible (port) MagicString by Rich-Harris implementation for Node and modern browsers, also, for rust, of course. Installa

Hana 35 Nov 21, 2022
ncnn Rust API.

rust-ncnn ncnn Rust API. Prequisition Rust Env $ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh CMake >= 3.12 Rust cmake needs --paral

null 11 Dec 27, 2022
Interact with the crate's API

cargo-api Interact with the crate's API Documentation Installation Getting Started Reference FAQ Contribute CHANGELOG Install Download a pre-built bin

null 7 Aug 9, 2022