Skip to main content

EnumerationRequest

Struct EnumerationRequest 

Source
pub struct EnumerationRequest { /* private fields */ }
Expand description

One directory to enumerate, with the predicate and bounds that apply to it.

Implementations§

Source§

impl EnumerationRequest

Source

pub fn new(path: &Wtf16Str) -> Result<Self, RequestError>

Build a request for a native WTF-16 path.

The path is validated and, unless it is already a verbatim \\?\ path, resolved to its fully qualified form now. The stored value is exactly what a worker will later open.

§Errors

Returns RequestError for an empty path, an interior NUL, a \\?\ path that is not fully qualified, an ordinary path longer than MAX_PATH before or after resolution, or a resolution failure reported by Windows.

Source

pub fn for_path(path: &Path) -> Result<Self, RequestError>

Build a request for a std path.

The conversion is lossless in both directions: a Windows Path is already WTF-16 underneath.

§Errors

As new.

Source

pub fn with_predicate(self, predicate: impl Into<EntryPredicate>) -> Self

Set the predicate entries must satisfy to be delivered.

Infallible because a QueryByExample validates each clause as it is added, so an invalid predicate cannot be built in the first place.

Source

pub fn with_file_identity(self, mode: FileIdentityMode) -> Self

Set how much work the request will do for file identity.

Source

pub fn with_buffer_capacity(self, bytes: usize) -> Result<Self, RequestError>

Set the native buffer capacity, in bytes.

The value is clamped up to MINIMUM_BUFFER_CAPACITY and then rounded up to the record alignment. The result is fixed for the request’s whole life: the buffer never grows in response to what a directory turns out to contain, because a bound that silently moves is not a bound. Read the value back with buffer_capacity.

§Errors

Returns RequestFailure::BufferCapacityUnrepresentable if the aligned capacity cannot be passed to Win32 as a u32.

Source

pub fn path(&self) -> &Wtf16Str

The exact path a worker will open.

Source

pub fn predicate(&self) -> &EntryPredicate

The predicate entries must satisfy.

Source

pub fn file_identity_mode(&self) -> FileIdentityMode

How much work the request will do for file identity.

Source

pub fn buffer_capacity(&self) -> usize

The effective native buffer capacity, in bytes, after clamping and alignment.

Trait Implementations§

Source§

impl Clone for EnumerationRequest

Source§

fn clone(&self) -> EnumerationRequest

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 Debug for EnumerationRequest

Source§

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

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

impl Eq for EnumerationRequest

Source§

impl PartialEq for EnumerationRequest

Source§

fn eq(&self, other: &EnumerationRequest) -> 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 EnumerationRequest

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, 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, <T as TryFrom<U>>::Error>

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.