Struct nix::sys::aio::AioFsync

source ·
#[repr(transparent)]
pub struct AioFsync { /* private fields */ }
Available on crate feature aio only.
Expand description

An asynchronous version of fsync(2).

References

aio_fsync

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§

Returns the operation’s fsync mode: data and metadata or data only?

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 minus prio.
  • sigev_notify: Determines how you will be notified of event completion.

Trait Implementations§

The return type of Aio::aio_return.
Cancels an outstanding AIO request. Read more
Retrieve error status of an asynchronous operation. Read more
Returns the underlying file descriptor associated with the operation.
Does this operation currently have any in-kernel state? Read more
Returns the priority of the AioCb
Update the notification settings for an existing AIO operation that has not yet been submitted.
Returns the SigEvent that will be used for notification.
Retrieve return status of an asynchronous operation. Read more
Actually start the I/O operation. Read more
Converts this type into a shared reference of the (usually inferred) input type.
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.