Sha256: f4d5fe22e50db7ff2df03069b8f3ddde8296aa8f2c9a10e9a149dfc716471950
Contents?: true
Size: 1.02 KB
Versions: 39
Compression:
Stored size: 1.02 KB
Contents
/// Extension trait for `cap_primitives::fs::OpenOptions` which adds /// `maybe_dir`, a function for controlling whether an open should attempt to /// succeed on a directory. On Posix-ish platforms, opening a directory always /// succeeds, but on Windows, opening a directory needs this option. pub trait OpenOptionsMaybeDirExt { /// Sets the option for disabling an error that might be generated by the /// opened object being a directory. /// /// On some platforms, this may prevent the directory from being deleted /// or renamed while the handle is open. fn maybe_dir(&mut self, maybe_dir: bool) -> &mut Self; } impl OpenOptionsMaybeDirExt for cap_primitives::fs::OpenOptions { #[inline] fn maybe_dir(&mut self, maybe_dir: bool) -> &mut Self { // `maybe_dir` functionality is implemented within `cap_primitives`; // we're just exposing it here since `OpenOptions` is re-exported by // `cap_std` etc. and `maybe_dir` isn't in `std`. self._cap_fs_ext_maybe_dir(maybe_dir) } }
Version data entries
39 entries across 39 versions & 1 rubygems