Skip to main content

EnumerationError

Enum EnumerationError 

Source
#[non_exhaustive]
pub enum EnumerationError { Impersonation(ApplyError), DirectoryOpen(Win32Error), VolumeIdentity(Win32Error), UnsupportedExtendedDirectoryInfo(Win32Error), DirectoryQuery(Win32Error), RecordTooLarge { buffer_capacity: usize, code: Win32Error, }, MalformedRecord(MalformedRecord), }
Expand description

Why an accepted enumeration failed.

An enumeration reaches this only after it has been accepted, so every value here arrives as the Failed terminal outcome for one EnumerationId – never as the result of a submission call.

Clean exhaustion is deliberately absent. ERROR_NO_MORE_FILES from any refill, and ERROR_FILE_NOT_FOUND from the very first one, are the two forms of “this directory has no more entries” and produce Completed.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Impersonation(ApplyError)

The worker could not apply the submitted impersonation context, so the directory was never opened under the submitter’s identity.

§

DirectoryOpen(Win32Error)

The directory could not be opened. Existence, access, and not-a-directory failures all arrive here, distinguished by the raw code.

§

VolumeIdentity(Win32Error)

A volume serial was Required and could not be obtained, so no entry could carry the globally meaningful identity the request demanded.

§

UnsupportedExtendedDirectoryInfo(Win32Error)

The filesystem does not support extended directory information.

The crate does not fall back to a metadata-poorer enumeration API, because that would silently drop change time, allocation size, extended-attribute size, and the 128-bit file ID from the contract.

§

DirectoryQuery(Win32Error)

A directory-information query failed for a reason that is neither clean exhaustion, an unsupported class, nor an oversize record.

§

RecordTooLarge

One record did not fit the request’s fixed native buffer.

The buffer never grows, so this is reported rather than hidden. Retry with an explicitly larger capacity.

Fields

§buffer_capacity: usize

The effective capacity, in bytes, that the record did not fit.

§code: Win32Error

The raw code the failing refill reported.

§

MalformedRecord(MalformedRecord)

A returned record failed validation before any of its fields were read.

Implementations§

Source§

impl EnumerationError

Source

pub fn code(&self) -> Option<Win32Error>

The raw Win32 code behind this failure, when one is available.

MalformedRecord has none – the record was rejected by this crate, not by Windows – and Impersonation carries the sibling crate’s typed error, whose own code is reachable through it.

Trait Implementations§

Source§

impl Debug for EnumerationError

Source§

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

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

impl Display for EnumerationError

Source§

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

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

impl Error for EnumerationError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

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> 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> 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, <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.