#[repr(transparent)]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
sourceimpl 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
sourceimpl Aio for AioFsync
impl Aio for AioFsync
type Output = ()
type Output = ()
The return type of
Aio::aio_return
.sourcefn cancel(self: Pin<&mut Self>) -> Result<AioCancelStat>
fn cancel(self: Pin<&mut Self>) -> Result<AioCancelStat>
Cancels an outstanding AIO request. Read more
sourcefn error(self: Pin<&mut Self>) -> Result<()>
fn error(self: Pin<&mut Self>) -> Result<()>
Retrieve error status of an asynchronous operation. Read more
sourcefn in_progress(&self) -> bool
fn in_progress(&self) -> bool
Does this operation currently have any in-kernel state? Read more
sourcefn 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. Read more
Auto Trait Implementations
impl RefUnwindSafe for AioFsync
impl Send for AioFsync
impl Sync for AioFsync
impl !Unpin for AioFsync
impl UnwindSafe for AioFsync
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more