pub trait OpenOptionsExt {
// Required methods
fn lookup_flags(&mut self, flags: u32) -> &mut Self;
fn directory(&mut self, dir: bool) -> &mut Self;
fn dsync(&mut self, dsync: bool) -> &mut Self;
fn nonblock(&mut self, nonblock: bool) -> &mut Self;
fn rsync(&mut self, rsync: bool) -> &mut Self;
fn sync(&mut self, sync: bool) -> &mut Self;
fn fs_rights_base(&mut self, rights: u64) -> &mut Self;
fn fs_rights_inheriting(&mut self, rights: u64) -> &mut Self;
fn open_at<P: AsRef<Path>>(&self, file: &File, path: P) -> Result<File>;
}
wasi_ext
#71213)Expand description
WASI-specific extensions to fs::OpenOptions
.
Required Methodsยง
Sourcefn lookup_flags(&mut self, flags: u32) -> &mut Self
๐ฌThis is a nightly-only experimental API. (wasi_ext
#71213)
fn lookup_flags(&mut self, flags: u32) -> &mut Self
wasi_ext
#71213)Pass custom dirflags
argument to path_open
.
This option configures the dirflags
argument to the
path_open
syscall which OpenOptions
will eventually call. The
dirflags
argument configures how the file is looked up, currently
primarily affecting whether symlinks are followed or not.
By default this value is __WASI_LOOKUP_SYMLINK_FOLLOW
, or symlinks are
followed. You can call this method with 0 to disable following symlinks
Sourcefn directory(&mut self, dir: bool) -> &mut Self
๐ฌThis is a nightly-only experimental API. (wasi_ext
#71213)
fn directory(&mut self, dir: bool) -> &mut Self
wasi_ext
#71213)Indicates whether OpenOptions
must open a directory or not.
This method will configure whether the __WASI_O_DIRECTORY
flag is
passed when opening a file. When passed it will require that the opened
path is a directory.
This option is by default false
Sourcefn dsync(&mut self, dsync: bool) -> &mut Self
๐ฌThis is a nightly-only experimental API. (wasi_ext
#71213)
fn dsync(&mut self, dsync: bool) -> &mut Self
wasi_ext
#71213)Indicates whether __WASI_FDFLAG_DSYNC
is passed in the fs_flags
field of path_open
.
This option is by default false
Sourcefn nonblock(&mut self, nonblock: bool) -> &mut Self
๐ฌThis is a nightly-only experimental API. (wasi_ext
#71213)
fn nonblock(&mut self, nonblock: bool) -> &mut Self
wasi_ext
#71213)Indicates whether __WASI_FDFLAG_NONBLOCK
is passed in the fs_flags
field of path_open
.
This option is by default false
Sourcefn rsync(&mut self, rsync: bool) -> &mut Self
๐ฌThis is a nightly-only experimental API. (wasi_ext
#71213)
fn rsync(&mut self, rsync: bool) -> &mut Self
wasi_ext
#71213)Indicates whether __WASI_FDFLAG_RSYNC
is passed in the fs_flags
field of path_open
.
This option is by default false
Sourcefn sync(&mut self, sync: bool) -> &mut Self
๐ฌThis is a nightly-only experimental API. (wasi_ext
#71213)
fn sync(&mut self, sync: bool) -> &mut Self
wasi_ext
#71213)Indicates whether __WASI_FDFLAG_SYNC
is passed in the fs_flags
field of path_open
.
This option is by default false
Sourcefn fs_rights_base(&mut self, rights: u64) -> &mut Self
๐ฌThis is a nightly-only experimental API. (wasi_ext
#71213)
fn fs_rights_base(&mut self, rights: u64) -> &mut Self
wasi_ext
#71213)Indicates the value that should be passed in for the fs_rights_base
parameter of path_open
.
This option defaults based on the read
and write
configuration of
this OpenOptions
builder. If this method is called, however, the
exact mask passed in will be used instead.
Sourcefn fs_rights_inheriting(&mut self, rights: u64) -> &mut Self
๐ฌThis is a nightly-only experimental API. (wasi_ext
#71213)
fn fs_rights_inheriting(&mut self, rights: u64) -> &mut Self
wasi_ext
#71213)Indicates the value that should be passed in for the
fs_rights_inheriting
parameter of path_open
.
The default for this option is the same value as what will be passed
for the fs_rights_base
parameter but if this method is called then
the specified value will be used instead.
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.