pub struct QueryVolumeInformation { /* private fields */ }Expand description
An owned, marshalable parameter set for GetVolumeInformationByHandleW.
§Example
use std::fs;
use std::os::windows::io::AsHandle;
use windows_namespace_request_sys::volume::QueryVolumeInformation;
use windows_namespace_request_sys::CapturedHandle;
let path = std::env::temp_dir().join(format!("wnrs-vol-{}.tmp", std::process::id()));
fs::write(&path, b"example")?;
let file = fs::File::open(&path)?;
let volume = QueryVolumeInformation::new(CapturedHandle::capture(file.as_handle())?)
.perform()?;
// A real volume names its filesystem and reports a component limit.
assert!(!volume.filesystem_name().is_empty());
assert!(volume.maximum_component_length() > 0);Implementations§
Source§impl QueryVolumeInformation
impl QueryVolumeInformation
Sourcepub fn new(handle: CapturedHandle) -> Self
pub fn new(handle: CapturedHandle) -> Self
Begins a request against handle.
The handle names any file or directory on the volume; the volume is what gets reported.
Sourcepub fn handle(&self) -> &CapturedHandle
pub fn handle(&self) -> &CapturedHandle
The owned duplicate of the handle being queried.
Sourcepub fn try_clone(&self) -> Result<Self, HandleCaptureError>
pub fn try_clone(&self) -> Result<Self, HandleCaptureError>
Copies the request, duplicating the handle.
§Errors
Returns the handle-capture failure when the handle cannot be duplicated.
Sourcepub fn perform(&self) -> Outcome<VolumeInformation>
pub fn perform(&self) -> Outcome<VolumeInformation>
Trait Implementations§
Source§impl Debug for QueryVolumeInformation
impl Debug for QueryVolumeInformation
Source§impl Request for QueryVolumeInformation
impl Request for QueryVolumeInformation
Source§type Error = Win32Error
type Error = Win32Error
How performing it can fail. Read more
Source§type Output = VolumeInformation
type Output = VolumeInformation
What performing the request produces.
Auto Trait Implementations§
impl Freeze for QueryVolumeInformation
impl RefUnwindSafe for QueryVolumeInformation
impl Send for QueryVolumeInformation
impl Sync for QueryVolumeInformation
impl Unpin for QueryVolumeInformation
impl UnsafeUnpin for QueryVolumeInformation
impl UnwindSafe for QueryVolumeInformation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more