Skip to main content

ReopenRequest

Struct ReopenRequest 

Source
pub struct ReopenRequest<B: Buffering = Cached, A: DataAccess = ReadWrite> { /* private fields */ }
Expand description

The request to reopen a handle, built by OpenedFile::request_reopen and made by perform. It holds the original, shared, so the handle it was built from can be closed first and the file stays reachable; 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 making a new handle.

Implementations§

Source§

impl<B: Buffering, A: DataAccess> ReopenRequest<B, A>

Source

pub fn original(&self) -> &SharedHandle

The handle being reopened, shared with its other holders.

Source

pub fn perform(&self) -> Result<OpenedFile<B, A>>

Reopen, on the calling thread. This blocks for as long as ReOpenFile does.

§Errors
  • SharingViolation (as an io::ErrorKind::ResourceBusy error), naming the file by OpenedBy::Reopen, when the reopen’s access or sharing conflicts with a handle still open to the file, the original among them.
  • The path open’s checks, made on the reopened handle by the same code: RemoteDevice when B is unbuffered and the original is on a share, and UnknownLocation when B is unbuffered and the reopened handle has no final path, as a device’s does not.
  • Otherwise whatever ReOpenFile reports, unaltered. The page says the original must have been created by CreateFile, and lists no codes.

Trait Implementations§

Source§

impl<B: Clone + Buffering, A: Clone + DataAccess> Clone for ReopenRequest<B, A>

Source§

fn clone(&self) -> Self

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<B: Debug + Buffering, A: Debug + DataAccess> Debug for ReopenRequest<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 ReopenRequest<B, A>
where PhantomData<fn() -> (B, A)>: Freeze,

§

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

§

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

§

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

§

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

§

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

§

impl<B, A> UnwindSafe for ReopenRequest<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> 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, !>

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.