Struct Reader

struct Reader<'buf, Fd: AsFd> { ... }

An inotify event iterator implemented with the read syscall.

See the RawDir API for more details and usage examples as this API is based on it.

Implementations

impl<'buf, Fd: AsFd> Reader<'buf, Fd>

fn next(self: &mut Self) -> Result<Event<'_>>

Read the next inotify event.

This is similar to Iterator::next except that it doesn't return an Option, because the stream doesn't have an ending. It always returns events or errors.

If there are no events in the buffer and none ready to be read:

fn is_buffer_empty(self: &Self) -> bool

Returns true if the internal buffer is empty and will be refilled when calling next. This is useful to avoid further blocking reads.

impl<'buf, Fd: AsFd> Reader<'buf, Fd>

fn new(fd: Fd, buf: &'buf mut [MaybeUninit<u8>]) -> Self

Create a new iterator from the given file descriptor and buffer.

impl<'buf, Fd> Freeze for Reader<'buf, Fd>

impl<'buf, Fd> RefUnwindSafe for Reader<'buf, Fd>

impl<'buf, Fd> Send for Reader<'buf, Fd>

impl<'buf, Fd> Sync for Reader<'buf, Fd>

impl<'buf, Fd> Unpin for Reader<'buf, Fd>

impl<'buf, Fd> UnsafeUnpin for Reader<'buf, Fd>

impl<'buf, Fd> UnwindSafe for Reader<'buf, Fd>

impl<T> Any for Reader<'buf, Fd>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Reader<'buf, Fd>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Reader<'buf, Fd>

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

impl<T> From for Reader<'buf, Fd>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Reader<'buf, Fd>

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Reader<'buf, Fd>

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

impl<T, U> TryInto for Reader<'buf, Fd>

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