Skip to main content

ReopenOptions

Struct ReopenOptions 

Source
pub struct ReopenOptions<A: DataAccess = NoData> { /* private fields */ }
Expand description

What to reopen with: the data access, the other rights, what other opens may do meanwhile, and the flags ReOpenFile takes that an open by path also offers. A reopen is shared for reading, writing and deletion until share says otherwise, as FileOptions shares an open.

There is no disposition, since a reopen reaches only what is open, and no attributes, which the page says cannot be given. FILE_FLAG_BACKUP_SEMANTICS and FILE_FLAG_WRITE_THROUGH, which the page lists, are not in v1, as for an open by path; the named-pipe security flags it lists for a pipe’s client are not offered either, since what this reopens is a file.

The share mode is judged against every handle still open to the file, the original among them: a reopen that does not share what the original asked for, or asks for what the original does not share, is refused, as the page says.

use win_durable_ioring::windows_backend::{ReadOnly, ReopenOptions};

let options: ReopenOptions<ReadOnly> = ReopenOptions::new().read();

Implementations§

Source§

impl ReopenOptions<NoData>

Source

pub fn new() -> Self

Nothing requested: no data access and no other right, shared for everything.

Source§

impl<A: DataAccess> ReopenOptions<A>

Source

pub fn read(self) -> ReopenOptions<A::WithRead>

Ask for the right to read the data, as FileOptions::read does.

Source

pub fn write(self) -> ReopenOptions<A::WithWrite>

Ask for the right to write the data, as FileOptions::write does.

Source

pub fn rights(self, rights: FileRights) -> Self

The rights besides the data access, as FileOptions::rights takes them. Calling this again replaces them.

Source

pub fn share(self, share: ShareMode) -> Self

What other opens may request while this handle is open (dwShareMode), as FileOptions::share takes it. Calling this again replaces it.

Source

pub fn open_reparse_point(self, open_reparse_point: bool) -> Self

Reopen a reparse point itself (FILE_FLAG_OPEN_REPARSE_POINT). The page says the flag is ignored for a file that is not a reparse point.

Source

pub fn delete_on_close(self, delete_on_close: bool) -> Self

Delete the file when its last handle is closed (FILE_FLAG_DELETE_ON_CLOSE), as FileOptions::delete_on_close describes. The page says the file goes when all of its handles are closed, the original’s and its duplicates’ too.

Source

pub fn open_no_recall(self, open_no_recall: bool) -> Self

Ask that the data not be brought back from remote storage (FILE_FLAG_OPEN_NO_RECALL), as FileOptions::open_no_recall does.

Source

pub fn posix_semantics(self, posix_semantics: bool) -> Self

Access the file by POSIX rules (FILE_FLAG_POSIX_SEMANTICS), as FileOptions::posix_semantics describes.

Source

pub fn overlapped(self, overlapped: bool) -> Self

Reopen for overlapped I/O (FILE_FLAG_OVERLAPPED), as FileOptions::overlapped describes.

Source

pub fn random_access(self, random_access: bool) -> Self

The random-access hint (FILE_FLAG_RANDOM_ACCESS), as FileOptions::random_access describes.

Source

pub fn sequential_scan(self, sequential_scan: bool) -> Self

The sequential-scan hint (FILE_FLAG_SEQUENTIAL_SCAN), as FileOptions::sequential_scan describes.

Trait Implementations§

Source§

impl<A: Clone + DataAccess> Clone for ReopenOptions<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<A: Copy + DataAccess> Copy for ReopenOptions<A>

Source§

impl<A: Debug + DataAccess> Debug for ReopenOptions<A>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ReopenOptions<NoData>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<A> Freeze for ReopenOptions<A>
where PhantomData<A>: Freeze,

§

impl<A> RefUnwindSafe for ReopenOptions<A>

§

impl<A> Send for ReopenOptions<A>
where PhantomData<A>: Send,

§

impl<A> Sync for ReopenOptions<A>
where PhantomData<A>: Sync,

§

impl<A> Unpin for ReopenOptions<A>
where PhantomData<A>: Unpin,

§

impl<A> UnsafeUnpin for ReopenOptions<A>

§

impl<A> UnwindSafe for ReopenOptions<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.