Skip to main content

Win32FileTarget

Struct Win32FileTarget 

Source
pub struct Win32FileTarget { /* private fields */ }
Expand description

A target backed by a Win32 file, a raw volume or a whole disk this crate opened, held as a SharedHandle – an owning form, never a raw handle (DI-D-4).

It is made from an OpenedFile, an OpenedVolume or an OpenedDisk and from nothing else, and takes its warranty class, its alignment and its capabilities from how that was opened, not from a declaration (DI-D-60): one opened cached is WarrantyClass::BestEffort, and one opened Unbuffered is WarrantyClass::SharedDevice, needs a sector’s alignment, and offers per-write write-through. WarrantyClass::Complete is never one’s: it needs knowledge of what else writes the device, which a volume’s lock does not give (DI-D-61).

A volume’s flush domains are found from its disks. A file’s are what it cannot know, so they are declared with with_domains; declaring them on a volume adds to the ones found, and never removes one.

Implementations§

Source§

impl Win32FileTarget

Source

pub fn new<B: Buffering>(file: OpenedFile<B>) -> Self

The target file makes, claiming what its open mode allows and no more.

Source

pub fn from_volume<B: Buffering>(volume: OpenedVolume<B>) -> Self

The target volume makes: its sector’s alignment, the flush domains of the disks it sits on, and what its open mode allows and no more.

Source

pub fn from_disk<B: Buffering>(disk: OpenedDisk<B>) -> Self

The target disk makes: its sector’s alignment, the disk itself as its flush domain, and what its open mode allows and no more.

Source

pub fn with_domains( self, domains: impl IntoIterator<Item = FlushDomain>, ) -> Self

Declare every flush domain its writes depend on, beyond any the backing found for itself. Declaring again replaces what was declared before, and never what the backing found.

Source

pub fn handle(&self) -> &SharedHandle

The file’s handle.

Trait Implementations§

Source§

impl Clone for Win32FileTarget

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 Debug for Win32FileTarget

Source§

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

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

impl IoTarget for Win32FileTarget

Source§

fn flush_domains(&self) -> &[FlushDomain]

Every flush domain its writes depend on. The declaration must be complete; an extra domain is safe, a missing one is not. None means it shares fate with every target.
Source§

fn warranty(&self) -> WarrantyClass

How far it honours its obligations.
Source§

fn geometry(&self) -> Geometry

The alignment its operations need.
Source§

fn capabilities(&self) -> Capabilities

What it offers beyond its obligations.
Source§

fn describe(&self) -> IoTargetDescription

Everything it states, as the core takes it.

Auto Trait Implementations§

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.