Skip to main content

async_fuser/
access_flags.rs

1use std::fmt::Display;
2use std::fmt::Formatter;
3
4use bitflags::bitflags;
5
6bitflags! {
7    /// Flags for [`access`](crate::Filesystem::access) operation.
8    #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
9    pub struct AccessFlags: i32 {
10        /// Test for the existence of a file. This is not a flag, but a constant zero.
11        const F_OK = libc::F_OK;
12        /// Test for read permission.
13        const R_OK = libc::R_OK;
14        /// Test for write permission.
15        const W_OK = libc::W_OK;
16        /// Test for execute permission.
17        const X_OK = libc::X_OK;
18    }
19}
20
21impl Display for AccessFlags {
22    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
23        Display::fmt(&self.bits(), f)
24    }
25}