pub struct AioFsync { /* private fields */ }
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
Source§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.
Auto Trait Implementations§
impl Freeze for AioFsync
impl RefUnwindSafe for AioFsync
impl Send for AioFsync
impl Sync for AioFsync
impl !Unpin for AioFsync
impl UnwindSafe for AioFsync
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more