pub struct AioFsync<'a> { /* 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_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<'a> AioFsync<'a>
impl<'a> AioFsync<'a>
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: BorrowedFd<'a>,
mode: AioFsyncMode,
prio: i32,
sigev_notify: SigevNotify<'_>,
) -> Self
pub fn new( fd: BorrowedFd<'a>, 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<'a> Aio for AioFsync<'a>
impl<'a> Aio for AioFsync<'a>
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 fd(&self) -> BorrowedFd<'a>
fn fd(&self) -> BorrowedFd<'a>
Returns the underlying file descriptor associated with the operation.
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<'a> Freeze for AioFsync<'a>
impl<'a> RefUnwindSafe for AioFsync<'a>
impl<'a> Send for AioFsync<'a>
impl<'a> Sync for AioFsync<'a>
impl<'a> !Unpin for AioFsync<'a>
impl<'a> UnwindSafe for AioFsync<'a>
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