Sha256: bd09a26a7cc0749458b72bf55dc96f5067558660b8480f334f3197c4b06c7ecd

Contents?: true

Size: 1.05 KB

Versions: 39

Compression:

Stored size: 1.05 KB

Contents

use crate::FollowSymlinks;

/// Extension trait for `cap_primitives::fs::OpenOptions` which adds
/// `follow`, a function for controlling whether a symlink in the last
/// component of a path is followed.
pub trait OpenOptionsFollowExt {
    /// Sets the option for following symlinks in the last component of a path.
    ///
    /// This option, when set to `FollowSymlinks::Yes`, will indicate that a
    /// symbolic link in the last component of a path will be followed. When
    /// set to `FollowSymlinks::No`, it will indicate that attempting to
    /// resolve a path which ends in a symbolic link will fail.
    fn follow(&mut self, follow: FollowSymlinks) -> &mut Self;
}

impl OpenOptionsFollowExt for cap_primitives::fs::OpenOptions {
    #[inline]
    fn follow(&mut self, follow: FollowSymlinks) -> &mut Self {
        // `follow` functionality is implemented within `cap_primitives`; we're
        // just exposing it here since `OpenOptions` is re-exported by
        // `cap_std` etc. and `follow` isn't in `std`.
        self._cap_fs_ext_follow(follow)
    }
}

Version data entries

39 entries across 39 versions & 1 rubygems

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