cap_fs_ext

Trait OpenOptionsSyncExt

Source
pub trait OpenOptionsSyncExt {
    // Required methods
    fn sync(&mut self, enable: bool) -> &mut Self;
    fn dsync(&mut self, enable: bool) -> &mut Self;
    fn rsync(&mut self, enable: bool) -> &mut Self;
    fn nonblock(&mut self, enable: bool) -> &mut Self;
}
Expand description

Extension trait for cap_primitives::fs::OpenOptions which adds sync, dsync, rsync, and nonblock functions for controlling various I/O modes for the opened file.

Required Methods§

Source

fn sync(&mut self, enable: bool) -> &mut Self

Requests write operations complete as defined by synchronized I/O file integrity completion.

Source

fn dsync(&mut self, enable: bool) -> &mut Self

Requests write operations complete as defined by synchronized I/O data integrity completion.

Source

fn rsync(&mut self, enable: bool) -> &mut Self

Requests read operations complete as defined by the level of integrity specified by sync and dsync.

Source

fn nonblock(&mut self, enable: bool) -> &mut Self

Requests that I/O operations fail with std::io::ErrorKind::WouldBlock if they would otherwise block.

This option is commonly not implemented for regular files, so blocking may still occur.

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.

Implementors§