[][src]Struct file_descriptors::fanotify::FanotifyFileDescriptor

pub struct FanotifyFileDescriptor(_);

Represents a fanotify instance.

fanotify requires the CAP_SYS_ADMIN capability, so is only suitable for priveleged processes or those running as root.

Methods

impl FanotifyFileDescriptor[src]

pub fn new(
    use_precontent_class: bool,
    use_content_class: bool,
    read_or_write: FanotifyReadOrWrite,
    file_status_flags: FileStatusFlags
) -> Result<Self, CreationError>
[src]

Creates a new instance.

The Notification class is always enabled.

pub fn add_mark<'a>(
    &self,
    mark_flags: MarkFlags,
    mark_event_flags: MarkEventFlags,
    mark_path: &MarkPath<'a>
) -> Result<(), FanotifyMarkError>
[src]

Adds a mark.

pub fn remove_mark<'a>(
    &self,
    mark_flags: MarkFlags,
    mark_event_flags: MarkEventFlags,
    mark_path: &MarkPath<'a>
) -> Result<(), FanotifyMarkError>
[src]

Remove a mark.

pub fn remove_all_mount_or_non_mount_marks<'a>(
    &self,
    remove_mount: bool,
    mark_event_flags: MarkEventFlags,
    mark_path: &MarkPath<'a>
) -> Result<(), FanotifyMarkError>
[src]

Remove all.

pub fn read(
    &self,
    read_into: &mut Vec<fanotify_event_metadata>
) -> Result<usize, StructReadError>
[src]

Reads a fanotify event.

Use this only after a read-ready event notification is received (using edge-triggered events).

Returns the number of items read; adds read items starting at read_into.len() up to read_into.capacity().

pub fn write_permission(
    &self,
    responses: &[fanotify_response]
) -> Result<usize, StructWriteError>
[src]

For permission events, the application must write responses.

Returns the number of responses written.

For extremely efficient handling, the responses slice should be backed by a virtual ring buffer (mirror buffer).

Trait Implementations

impl AsRawFd for FanotifyFileDescriptor[src]

impl AsRawFdExt for FanotifyFileDescriptor[src]

impl Debug for FanotifyFileDescriptor[src]

impl Drop for FanotifyFileDescriptor[src]

impl Eq for FanotifyFileDescriptor[src]

impl FromRawFd for FanotifyFileDescriptor[src]

impl Hash for FanotifyFileDescriptor[src]

impl IntoRawFd for FanotifyFileDescriptor[src]

impl Ord for FanotifyFileDescriptor[src]

impl PartialEq<FanotifyFileDescriptor> for FanotifyFileDescriptor[src]

impl PartialOrd<FanotifyFileDescriptor> for FanotifyFileDescriptor[src]

impl StructuralEq for FanotifyFileDescriptor[src]

impl StructuralPartialEq for FanotifyFileDescriptor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.