Skip to main content

FileInformationClass

Struct FileInformationClass 

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

Which information the query asks for.

A newtype over FILE_INFO_BY_HANDLE_CLASS rather than an enum, because Windows defines classes this crate has never heard of and refusing them would narrow the entry. The named constants are the five the audit found; any other class reaches Windows unaltered through from_raw.

§Example

use windows_namespace_request_sys::query::FileInformationClass;
use windows_sys::Win32::Storage::FileSystem::{FileBasicInfo, FileStandardInfo};

assert_eq!(FileInformationClass::BASIC.as_raw(), FileBasicInfo);

// A class with no named constant here is still expressible.
let standard = FileInformationClass::from_raw(FileStandardInfo);
assert_eq!(standard.as_raw(), FileStandardInfo);

Implementations§

Source§

impl FileInformationClass

Source

pub const BASIC: Self

FileBasicInfo: timestamps and attributes. A pure read.

Source

pub const ID: Self

FileIdInfo: the volume serial and 128-bit file id. A pure read.

Source

pub const CASE_SENSITIVE: Self

FileCaseSensitiveInfo: whether the directory is case-sensitive. A pure read.

Source

pub const ID_EXTD_DIRECTORY: Self

FileIdExtdDirectoryInfo: the next batch of directory entries.

Advances the enumeration cursor, which lives in the file object and is therefore shared with every duplicate of the handle.

Source

pub const ID_EXTD_DIRECTORY_RESTART: Self

FileIdExtdDirectoryRestartInfo: the first batch, restarting the enumeration.

Resets the enumeration cursor, with the same sharing consequence.

Source

pub const fn from_raw(class: FILE_INFO_BY_HANDLE_CLASS) -> Self

Wraps a raw FILE_INFO_BY_HANDLE_CLASS.

Source

pub const fn as_raw(self) -> FILE_INFO_BY_HANDLE_CLASS

The raw class value.

Source

pub const fn moves_enumeration_cursor(self) -> bool

Whether this class mutates the handle’s shared enumeration cursor.

True only for the two directory-enumeration classes. Every other class is a pure read that composes freely with an enumeration in progress, measured rather than assumed.

An unrecognised class reports false, because this answers “is this one of the two known cursor-moving classes”, not “is this provably safe”.

§Example
use windows_namespace_request_sys::query::FileInformationClass;

assert!(FileInformationClass::ID_EXTD_DIRECTORY.moves_enumeration_cursor());
assert!(FileInformationClass::ID_EXTD_DIRECTORY_RESTART.moves_enumeration_cursor());

// Interleaving one of these with an enumeration is safe: measured, not
// reasoned from the object model.
assert!(!FileInformationClass::BASIC.moves_enumeration_cursor());
assert!(!FileInformationClass::ID.moves_enumeration_cursor());

Trait Implementations§

Source§

impl Clone for FileInformationClass

Source§

fn clone(&self) -> FileInformationClass

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 FileInformationClass

Source§

impl Debug for FileInformationClass

Source§

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

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

impl Eq for FileInformationClass

Source§

impl Hash for FileInformationClass

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 FileInformationClass

Source§

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

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.