Skip to main content

ByIdOptions

Struct ByIdOptions 

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

What to open by identifier: the data access, the other rights, what other opens may do meanwhile, whether a link is opened or followed, and the hints, which are what OpenFileById takes. A file is shared for reading, writing and deletion until share says otherwise, as FileOptions shares it.

There is no disposition, since the call opens only what exists; no attributes, which its page says it ignores; no security descriptor, which it marks reserved; and no delete-on-close or POSIX semantics, which it does not list. FILE_FLAG_BACKUP_SEMANTICS, which a directory needs, and FILE_FLAG_WRITE_THROUGH are not in v1, as for an open by path.

use win_durable_ioring::windows_backend::{ByIdOptions, ReadOnly, ShareMode};

let options: ByIdOptions<ReadOnly> = ByIdOptions::new().read().share(ShareMode::READ);

Implementations§

Source§

impl ByIdOptions<NoData>

Source

pub fn new() -> Self

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

Source§

impl<A: DataAccess> ByIdOptions<A>

Source

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

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

Source

pub fn write(self) -> ByIdOptions<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

Open a reparse point itself and not what it points to (FILE_FLAG_OPEN_REPARSE_POINT). The page says the flag is ignored for a file that is not a reparse point.

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 overlapped(self, overlapped: bool) -> Self

Open 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 ByIdOptions<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 ByIdOptions<A>

Source§

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

Source§

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

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

impl Default for ByIdOptions<NoData>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

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

§

impl<A> RefUnwindSafe for ByIdOptions<A>

§

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

§

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

§

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

§

impl<A> UnsafeUnpin for ByIdOptions<A>

§

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