Skip to main content

ByIdRequest

Struct ByIdRequest 

Source
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>

Source

pub fn identifier(&self) -> FileIdentifier

The identifier this request opens.

Source

pub fn volume_hint(&self) -> &SharedHandle

The hint whose volume the identifier is opened on, shared with its other holders.

Source

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 an io::ErrorKind::ResourceBusy error), naming the file by OpenedBy::Identifier, when the file is open in a way that conflicts with this open’s access or sharing.
  • For a FileIdentifier::Extended, IdentityMismatch (as an io::ErrorKind::InvalidInput error) 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, RemoteDevice and UnknownLocation, 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 OpenFileById reports, unaltered. The page names one, ERROR_ACCESS_DENIED for a file pending deletion; an identifier that names nothing is the kernel’s error, and the page does not say which.

Trait Implementations§

Source§

impl<B: Debug + Buffering, A: Debug + DataAccess> Debug for ByIdRequest<B, A>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B, A> Freeze for ByIdRequest<B, A>
where PhantomData<fn() -> (B, A)>: Freeze,

§

impl<B, A> RefUnwindSafe for ByIdRequest<B, A>

§

impl<B, A> Send for ByIdRequest<B, A>
where PhantomData<fn() -> (B, A)>: Send,

§

impl<B, A> Sync for ByIdRequest<B, A>
where PhantomData<fn() -> (B, A)>: Sync,

§

impl<B, A> Unpin for ByIdRequest<B, A>
where PhantomData<fn() -> (B, A)>: Unpin,

§

impl<B, A> UnsafeUnpin for ByIdRequest<B, A>

§

impl<B, A> UnwindSafe for ByIdRequest<B, A>

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> 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, 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, !>

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.