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
impl Win32FileTarget
Sourcepub fn new<B: Buffering>(file: OpenedFile<B>) -> Self
pub fn new<B: Buffering>(file: OpenedFile<B>) -> Self
The target file makes, claiming what its open mode allows and no more.
Sourcepub fn from_volume<B: Buffering>(volume: OpenedVolume<B>) -> Self
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.
Sourcepub fn from_disk<B: Buffering>(disk: OpenedDisk<B>) -> Self
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.
Sourcepub fn with_domains(
self,
domains: impl IntoIterator<Item = FlushDomain>,
) -> Self
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.
Sourcepub fn handle(&self) -> &SharedHandle
pub fn handle(&self) -> &SharedHandle
The file’s handle.