pub struct Inotify { /* private fields */ }Expand description
Instance inotify : possède un [OwnedFd], fermé au Drop.
Implementations§
Source§impl Inotify
impl Inotify
Sourcepub fn as_fd(&self) -> BorrowedFd<'_>
pub fn as_fd(&self) -> BorrowedFd<'_>
FD emprunté (intégration dans une boucle d’événements — poll/io_uring).
Sourcepub fn into_fd(self) -> OwnedFd
pub fn into_fd(self) -> OwnedFd
Consomme l’instance et rend l’[OwnedFd] (transfert d’ownership).
Sourcepub fn add_watch(
&self,
path: &CStr,
mask: InotifyEventMask,
) -> Result<WatchDescriptor, Errno>
pub fn add_watch( &self, path: &CStr, mask: InotifyEventMask, ) -> Result<WatchDescriptor, Errno>
Ajoute (ou met à jour, avec [InotifyEventMask::MASK_ADD]) un watch sur
path pour les événements mask. path : &CStr (octets terminés NUL,
convention couche 0).
§Errors
- [
Errno::ENOSPC] : limitemax_user_watchesatteinte. - [
Errno::ENOENT] :pathn’existe pas. - [
Errno::EACCES] : accès en lecture refusé surpath. - [
Errno::ENOTDIR] : [InotifyEventMask::ONLYDIR] posé etpathn’est pas un répertoire.
Sourcepub fn remove_watch(&self, wd: WatchDescriptor) -> Result<(), Errno>
pub fn remove_watch(&self, wd: WatchDescriptor) -> Result<(), Errno>
Sourcepub fn read_events<'b>(
&self,
buffer: &'b mut [u8],
) -> Result<InotifyEvents<'b>, Errno>
pub fn read_events<'b>( &self, buffer: &'b mut [u8], ) -> Result<InotifyEvents<'b>, Errno>
Lit un lot d’événements dans buffer (fourni par l’appelant, zéro
allocation) et le décode. Le [InotifyEvents] retourné emprunte
buffer ; l’appelant l’itère puis peut consulter
[InotifyEvents::truncated] (ADR-032 : un événement coupé est signalé,
jamais avalé).
§Errors
- [
Errno::EAGAIN] : FD [InotifyFlags::NONBLOCK] et aucun événement prêt. - [
Errno::EINVAL] :buffertrop petit pour le prochain événement (l’appelant agrandit — recommandé :INOTIFY_RECOMMENDED_BUFFER_SIZE).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Inotify
impl RefUnwindSafe for Inotify
impl Send for Inotify
impl Sync for Inotify
impl Unpin for Inotify
impl UnsafeUnpin for Inotify
impl UnwindSafe for Inotify
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