fuse_abi/lib.rs
1//! This crate provides bindings to FUSE devices.
2//!
3//! # Features
4//!
5//! This crate has the following Cargo features:
6//! - `linux` enables the [`linux`] module.
7//! - Automatically enabled on Linux systems.
8//! - `macos` enables the [`macos`] module.
9//! - Automatically enabled on macOS systems.
10//! - `num_enum` derives the following traits for enums:
11//! - [`num_enum::IntoPrimitive`]
12//! - [`num_enum::TryFromPrimitive`]
13//! - [`num_enum::UnsafeFromPrimitive`]
14//! - `zerocopy` derives the following traits for all structs:
15//! - [`zerocopy::KnownLayout`]
16//! - [`zerocopy::Immutable`]
17//! - [`zerocopy::FromBytes`]
18//! - [`zerocopy::IntoBytes`]
19
20#![no_std]
21#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22#![allow(non_camel_case_types)]
23
24/// Linux FUSE device interface ([`fuse(4)`], [`linux/fuse.h`]).
25///
26/// [`fuse(4)`]: https://www.man7.org/linux/man-pages/man4/fuse.4.html
27/// [`linux/fuse.h`]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/fuse.h?h=v6.9
28#[cfg(any(target_os = "linux", feature = "linux"))]
29pub mod linux;
30
31/// macFUSE device interface ([`fuse_kernel.h`]).
32///
33/// [`fuse_kernel.h`]: https://github.com/osxfuse/fuse/blob/6f7322893456f6ff9db145f096b9bfc2ba95d627/include/fuse_kernel.h
34#[cfg(any(target_os = "macos", feature = "macos"))]
35pub mod macos;
36
37#[cfg(any(target_os = "linux", target_os = "macos"))]
38pub mod os {
39 //! OS-specific FUSE device interface.
40
41 #[cfg(target_os = "linux")]
42 pub use super::linux::*;
43 #[cfg(target_os = "macos")]
44 pub use super::macos::*;
45}