Skip to main content

NotifyFilter

Struct NotifyFilter 

Source
pub struct NotifyFilter(/* private fields */);
Expand description

Which changes a watch reports.

A thin newtype over FILE_NOTIFY_CHANGE rather than an enum, because the value is a bitmask and Windows may define bits this crate has not heard of. The named constants are provided for convenience; an unknown bit still reaches Windows unaltered.

§Example

use windows_namespace_request_sys::watch::NotifyFilter;

let combined = NotifyFilter::FILE_NAME | NotifyFilter::DIR_NAME;

assert!(combined.contains(NotifyFilter::FILE_NAME));
assert!(!combined.contains(NotifyFilter::SIZE));

// A bitmask, not an enum: a bit Windows defines and this crate has never
// heard of still reaches it.
let unknown = NotifyFilter::from_bits(0x8000_0000);
assert_eq!(unknown.bits(), 0x8000_0000);

// The empty filter watches nothing, and Windows -- not this crate --
// rejects it at the call.
assert_eq!(NotifyFilter::NONE.bits(), 0);

Implementations§

Source§

impl NotifyFilter

Source

pub const NONE: Self

An empty filter, which watches for nothing.

Windows rejects this at the call, which is left to happen rather than pre-empted here.

Source

pub const FILE_NAME: Self

File name creation, deletion, or rename.

Source

pub const DIR_NAME: Self

Directory creation or deletion.

Source

pub const ATTRIBUTES: Self

Attribute changes.

Source

pub const SIZE: Self

Size changes, reported when the file is flushed rather than on write.

Source

pub const LAST_WRITE: Self

Last-write-time changes, likewise reported on flush.

Source

pub const LAST_ACCESS: Self

Last-access-time changes.

Source

pub const CREATION: Self

Creation-time changes.

Source

pub const SECURITY: Self

Security-descriptor changes.

Source

pub const fn from_bits(bits: FILE_NOTIFY_CHANGE) -> Self

Wraps a raw FILE_NOTIFY_CHANGE mask.

Any bit pattern is accepted: the crate does not decide which bits Windows understands.

Source

pub const fn bits(self) -> FILE_NOTIFY_CHANGE

The raw mask.

Source

pub const fn union(self, other: Self) -> Self

The union of two filters.

Source

pub const fn contains(self, other: Self) -> bool

Whether every bit of other is set in this filter.

Trait Implementations§

Source§

impl BitOr for NotifyFilter

Source§

type Output = NotifyFilter

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Self) -> Self

Performs the | operation. Read more
Source§

impl Clone for NotifyFilter

Source§

fn clone(&self) -> NotifyFilter

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NotifyFilter

Source§

impl Debug for NotifyFilter

Source§

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

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

impl Default for NotifyFilter

Source§

fn default() -> NotifyFilter

Returns the “default value” for a type. Read more
Source§

impl Display for NotifyFilter

Source§

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

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

impl Eq for NotifyFilter

Source§

impl Hash for NotifyFilter

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for NotifyFilter

Source§

fn eq(&self, other: &NotifyFilter) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NotifyFilter

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.