#[repr(transparent)]pub struct AioFsync { /* private fields */ }
Available on crate feature
aio
only.Expand description
An asynchronous version of fsync(2)
.
References
Examples
let f = tempfile().unwrap();
let mut aiof = Box::pin(AioFsync::new(f.as_raw_fd(), AioFsyncMode::O_SYNC,
0, SigevNone));
aiof.as_mut().submit().expect("aio_fsync failed early");
while (aiof.as_mut().error() == Err(Errno::EINPROGRESS)) {
thread::sleep(time::Duration::from_millis(10));
}
aiof.as_mut().aio_return().expect("aio_fsync failed late");
Implementations§
source§impl AioFsync
impl AioFsync
sourcepub fn mode(&self) -> AioFsyncMode
pub fn mode(&self) -> AioFsyncMode
Returns the operation’s fsync mode: data and metadata or data only?
sourcepub fn new(
fd: RawFd,
mode: AioFsyncMode,
prio: i32,
sigev_notify: SigevNotify
) -> Self
pub fn new(
fd: RawFd,
mode: AioFsyncMode,
prio: i32,
sigev_notify: SigevNotify
) -> Self
Create a new AioFsync
.
Arguments
fd
: File descriptor to sync.mode
: Whether to sync file metadata too, or just data.prio
: If POSIX Prioritized IO is supported, then the operation will be prioritized at the process’s priority level minusprio
.sigev_notify
: Determines how you will be notified of event completion.
Trait Implementations§
source§impl Aio for AioFsync
impl Aio for AioFsync
§type Output = ()
type Output = ()
The return type of
Aio::aio_return
.source§fn cancel(self: Pin<&mut Self>) -> Result<AioCancelStat>
fn cancel(self: Pin<&mut Self>) -> Result<AioCancelStat>
Cancels an outstanding AIO request. Read more
source§fn error(self: Pin<&mut Self>) -> Result<()>
fn error(self: Pin<&mut Self>) -> Result<()>
Retrieve error status of an asynchronous operation. Read more
source§fn in_progress(&self) -> bool
fn in_progress(&self) -> bool
Does this operation currently have any in-kernel state? Read more
source§fn set_sigev_notify(&mut self, sev: SigevNotify)
fn set_sigev_notify(&mut self, sev: SigevNotify)
Update the notification settings for an existing AIO operation that has
not yet been submitted.