Struct nix::sys::aio::AioFsync

source ·
pub struct AioFsync<'a> { /* private fields */ }
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_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>

source

pub fn mode(&self) -> AioFsyncMode

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

source

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

Trait Implementations§

source§

impl<'a> Aio for AioFsync<'a>

source§

type Output = ()

The return type of Aio::aio_return.
source§

fn cancel(self: Pin<&mut Self>) -> Result<AioCancelStat>

Cancels an outstanding AIO request. Read more
source§

fn error(self: Pin<&mut Self>) -> Result<()>

Retrieve error status of an asynchronous operation. Read more
source§

fn fd(&self) -> BorrowedFd<'a>

Returns the underlying file descriptor associated with the operation.
source§

fn in_progress(&self) -> bool

Does this operation currently have any in-kernel state? Read more
source§

fn priority(&self) -> i32

Returns the priority of the AioCb
source§

fn set_sigev_notify(&mut self, sev: SigevNotify<'_>)

Update the notification settings for an existing AIO operation that has not yet been submitted.
source§

fn sigevent(&self) -> SigEvent

Returns the SigEvent that will be used for notification.
source§

fn aio_return(self: Pin<&mut Self>) -> Result<()>

Retrieve return status of an asynchronous operation. Read more
source§

fn submit(self: Pin<&mut Self>) -> Result<()>

Actually start the I/O operation. Read more
source§

impl<'a> AsRef<aiocb> for AioFsync<'a>

source§

fn as_ref(&self) -> &aiocb

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> Debug for AioFsync<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.