#[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
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
code: Win32ErrorThe raw code the failing refill reported.
MalformedRecord(MalformedRecord)
A returned record failed validation before any of its fields were read.
Implementations§
Source§impl EnumerationError
impl EnumerationError
Sourcepub fn code(&self) -> Option<Win32Error>
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
impl Debug for EnumerationError
Source§impl Display for EnumerationError
impl Display for EnumerationError
Source§impl Error for EnumerationError
impl Error for EnumerationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()