pub struct QueryFinalPath { /* private fields */ }Expand description
An owned, marshalable parameter set for GetFinalPathNameByHandleW.
§Example
use std::fs;
use windows_namespace_request_sys::final_path::QueryFinalPath;
let path = std::env::temp_dir().join(format!("wnrs-fp-{}.tmp", std::process::id()));
fs::write(&path, b"example")?;
let file = fs::File::open(&path)?;
// Built here; it would resolve identically on a worker, which is the point:
// Globazog performs this on its submitting thread today.
let resolved = QueryFinalPath::new(file)
.perform()?
.to_string_lossy();
// The result is a verbatim path, so it names the object unambiguously.
assert!(resolved.starts_with(r"\\?\"), "unexpected: {resolved}");
assert!(resolved.ends_with(".tmp"), "unexpected: {resolved}");Implementations§
Source§impl QueryFinalPath
impl QueryFinalPath
Sourcepub fn new(handle: impl Into<SharedHandle>) -> Self
pub fn new(handle: impl Into<SharedHandle>) -> Self
Begins a request against handle, in the form the audited watcher uses.
Sourcepub fn with_flags(self, flags: FinalPathFlags) -> Self
pub fn with_flags(self, flags: FinalPathFlags) -> Self
Sets dwFlags.
Sourcepub fn handle(&self) -> &SharedHandle
pub fn handle(&self) -> &SharedHandle
The handle being resolved, shared with its other holders.
Sourcepub fn flags(&self) -> FinalPathFlags
pub fn flags(&self) -> FinalPathFlags
The flags the call will use.
Sourcepub fn perform(&self) -> Result<Wtf16String, FinalPathError>
pub fn perform(&self) -> Result<Wtf16String, FinalPathError>
Performs the call on the calling thread, growing the buffer as needed.
§Errors
Returns FinalPathError::Win32 with the raw code unaltered, or
FinalPathError::Unstable if the required size kept changing.
Trait Implementations§
Source§impl Clone for QueryFinalPath
impl Clone for QueryFinalPath
Source§impl Debug for QueryFinalPath
impl Debug for QueryFinalPath
Auto Trait Implementations§
impl Freeze for QueryFinalPath
impl RefUnwindSafe for QueryFinalPath
impl Send for QueryFinalPath
impl Sync for QueryFinalPath
impl Unpin for QueryFinalPath
impl UnsafeUnpin for QueryFinalPath
impl UnwindSafe for QueryFinalPath
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