Sha256: 6653891a49b44a34bff1a14277aba4ef7c87ff2e217ad54693bfe7fa1c316a0c

Contents?: true

Size: 984 Bytes

Versions: 38

Compression:

Stored size: 984 Bytes

Contents

/// Should symlinks be followed in the last component of a path?
///
/// This doesn't affect path components other than the last. So for example in
/// "foo/bar/baz", if "foo" or "bar" are symlinks, they will always be
/// followed. This enum value only determines whether "baz" is followed.
///
/// Instead of passing bare `bool`s as parameters, pass a distinct enum so that
/// the intent is clear.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
pub enum FollowSymlinks {
    /// Yes, do follow symlinks in the last component of a path.
    Yes,

    /// No, do not follow symlinks in the last component of a path.
    No,
}

impl FollowSymlinks {
    /// Convert a bool where true means "follow" and false means "don't follow"
    /// to a `FollowSymlinks`.
    #[inline]
    pub const fn follow(follow: bool) -> Self {
        if follow {
            Self::Yes
        } else {
            Self::No
        }
    }
}

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/cap-primitives-3.4.2/src/fs/follow_symlinks.rs
wasmtime-28.0.0 ./ext/cargo-vendor/cap-primitives-3.4.2/src/fs/follow_symlinks.rs
wasmtime-27.0.0 ./ext/cargo-vendor/cap-primitives-3.4.1/src/fs/follow_symlinks.rs
wasmtime-26.0.0 ./ext/cargo-vendor/cap-primitives-3.3.0/src/fs/follow_symlinks.rs
wasmtime-25.0.2 ./ext/cargo-vendor/cap-primitives-3.2.0/src/fs/follow_symlinks.rs
wasmtime-25.0.1 ./ext/cargo-vendor/cap-primitives-3.2.0/src/fs/follow_symlinks.rs
wasmtime-25.0.0 ./ext/cargo-vendor/cap-primitives-3.2.0/src/fs/follow_symlinks.rs
wasmtime-24.0.0 ./ext/cargo-vendor/cap-primitives-3.2.0/src/fs/follow_symlinks.rs
wasmtime-23.0.2 ./ext/cargo-vendor/cap-primitives-3.1.0/src/fs/follow_symlinks.rs
wasmtime-22.0.0 ./ext/cargo-vendor/cap-primitives-3.1.0/src/fs/follow_symlinks.rs
wasmtime-21.0.1 ./ext/cargo-vendor/cap-primitives-3.1.0/src/fs/follow_symlinks.rs
wasmtime-20.0.2 ./ext/cargo-vendor/cap-primitives-3.1.0/src/fs/follow_symlinks.rs
wasmtime-20.0.0 ./ext/cargo-vendor/cap-primitives-3.0.0/src/fs/follow_symlinks.rs
wasmtime-18.0.3 ./ext/cargo-vendor/cap-primitives-2.0.1/src/fs/follow_symlinks.rs
wasmtime-17.0.1 ./ext/cargo-vendor/cap-primitives-2.0.1/src/fs/follow_symlinks.rs
wasmtime-17.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/fs/follow_symlinks.rs
wasmtime-16.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/fs/follow_symlinks.rs
wasmtime-15.0.1 ./ext/cargo-vendor/cap-primitives-2.0.1/src/fs/follow_symlinks.rs
wasmtime-15.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/fs/follow_symlinks.rs
wasmtime-14.0.4 ./ext/cargo-vendor/cap-primitives-2.0.0/src/fs/follow_symlinks.rs