Struct mio_aio::Source

source ·
pub struct Source<T> { /* private fields */ }
Expand description

A Mio source based on a single POSIX AIO operation.

The generic parameter specifies exactly which operation it is. This struct implements mio::Source. After creation, use mio::Source::register to connect it to the event loop.

Implementations§

source§

impl<'a> Source<AioFsync<'a>>

source

pub fn fsync(fd: BorrowedFd<'a>, mode: AioFsyncMode, prio: i32) -> Self

Asynchronously fsync a file.

source§

impl<'a> Source<AioRead<'a>>

source

pub fn read_at( fd: BorrowedFd<'a>, offs: u64, buf: &'a mut [u8], prio: i32 ) -> Self

Asynchronously read from a file.

source§

impl<'a> Source<AioReadv<'a>>

source

pub fn readv_at( fd: BorrowedFd<'a>, offs: u64, bufs: &mut [IoSliceMut<'a>], prio: i32 ) -> Self

Asynchronously read from a file to a scatter/gather list of buffers.

Requires FreeBSD 13.0 or later.

source§

impl<'a> Source<AioWrite<'a>>

source

pub fn write_at(fd: BorrowedFd<'a>, offs: u64, buf: &'a [u8], prio: i32) -> Self

Asynchronously write to a file.

source§

impl<'a> Source<AioWritev<'a>>

source

pub fn writev_at( fd: BorrowedFd<'a>, offs: u64, bufs: &[IoSlice<'a>], prio: i32 ) -> Self

Asynchronously write to a file to a scatter/gather list of buffers.

Requires FreeBSD 13.0 or later.

Trait Implementations§

source§

impl<T: Debug> Debug for Source<T>

source§

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

Formats the value using the given formatter. Read more
source§

impl<T: Aio> Source for Source<T>

source§

fn register( &mut self, registry: &Registry, token: Token, interests: Interest ) -> Result<()>

Register self with the given Registry instance. Read more
source§

fn reregister( &mut self, registry: &Registry, token: Token, interests: Interest ) -> Result<()>

Re-register self with the given Registry instance. Read more
source§

fn deregister(&mut self, _registry: &Registry) -> Result<()>

Deregister self from the given Registry instance. Read more
source§

impl<T: Aio> SourceApi for Source<T>

§

type Output = <T as Aio>::Output

Return type of SourceApi::aio_return.
source§

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

Read the final result of the operation
source§

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

Ask the operating system to cancel the operation Read more
source§

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

Retrieve the status of an in-progress or complete operation. Read more
source§

fn in_progress(&self) -> bool

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

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

Actually start the I/O operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Source<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Source<T>
where T: RefUnwindSafe,

§

impl<T> Send for Source<T>
where T: Send,

§

impl<T> Sync for Source<T>
where T: Sync,

§

impl<T> Unpin for Source<T>
where T: Unpin,

§

impl<T> UnwindSafe for Source<T>
where T: UnwindSafe,

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>,

§

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>,

§

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.