pub struct ByIdRequest<B: Buffering = Cached, A: DataAccess = ReadWrite> { /* private fields */ }Expand description
The request to open a file by identifier, built by OpenedFile::request_by_id and made by
perform. It holds the hint, shared, so the handle it was built from can be
closed first; it is Send, so it can be performed on a thread that can afford to block; and it
can be performed more than once, each time opening the file again.
Implementations§
Source§impl<B: Buffering, A: DataAccess> ByIdRequest<B, A>
impl<B: Buffering, A: DataAccess> ByIdRequest<B, A>
Sourcepub fn identifier(&self) -> FileIdentifier
pub fn identifier(&self) -> FileIdentifier
The identifier this request opens.
Sourcepub fn volume_hint(&self) -> &SharedHandle
pub fn volume_hint(&self) -> &SharedHandle
The hint whose volume the identifier is opened on, shared with its other holders.
Sourcepub fn perform(&self) -> Result<OpenedFile<B, A>>
pub fn perform(&self) -> Result<OpenedFile<B, A>>
Open the file, on the calling thread. This blocks for as long as OpenFileById does.
§Errors
SharingViolation(as anio::ErrorKind::ResourceBusyerror), naming the file byOpenedBy::Identifier, when the file is open in a way that conflicts with this open’s access or sharing.- For a
FileIdentifier::Extended,IdentityMismatch(as anio::ErrorKind::InvalidInputerror) when the file opened is not the identity asked for, which is a hint on another volume; the handle is closed. An error reading the opened file’s identity is returned as it came. - The path open’s checks,
RemoteDeviceandUnknownLocation, made on the opened handle by the same code. No test reaches them by identifier: the page lists SMB as not supported, so an open by identifier on a share is the kernel’s to refuse, and the call opens only a file on a file system, whose final path is readable. - Otherwise whatever
OpenFileByIdreports, unaltered. The page names one,ERROR_ACCESS_DENIEDfor a file pending deletion; an identifier that names nothing is the kernel’s error, and the page does not say which.
Trait Implementations§
Auto Trait Implementations§
impl<B, A> Freeze for ByIdRequest<B, A>
impl<B, A> RefUnwindSafe for ByIdRequest<B, A>
impl<B, A> Send for ByIdRequest<B, A>
impl<B, A> Sync for ByIdRequest<B, A>
impl<B, A> Unpin for ByIdRequest<B, A>
impl<B, A> UnsafeUnpin for ByIdRequest<B, A>
impl<B, A> UnwindSafe for ByIdRequest<B, A>
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