Skip to main content

async_fuser/
rename_flags.rs

1use std::fmt;
2
3use bitflags::bitflags;
4
5bitflags! {
6    /// `renameat2` flags.
7    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
8    pub struct RenameFlags: u32 {
9        /// Don't overwrite newpath of the rename.
10        #[cfg(target_os = "linux")]
11        const RENAME_NOREPLACE = libc::RENAME_NOREPLACE;
12        /// Atomically exchange oldpath and newpath.
13        #[cfg(target_os = "linux")]
14        const RENAME_EXCHANGE = libc::RENAME_EXCHANGE;
15        /// Overlay/union-specific operation.
16        #[cfg(target_os = "linux")]
17        const RENAME_WHITEOUT = libc::RENAME_WHITEOUT;
18    }
19}
20
21impl fmt::Display for RenameFlags {
22    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23        fmt::Display::fmt(&self.bits(), f)
24    }
25}