pub struct LogicalWriter { /* private fields */ }Expand description
Builds an L01/Lx01 catalog and file hashes while accepting file streams.
Uses the general writer’s temporary spools and publication transaction.
This is not checkpoint-resumable acquisition. Input errors or cancellation
poison the builder so partial files cannot be published by finish.
Implementations§
Source§impl LogicalWriter
impl LogicalWriter
Sourcepub fn create(path: impl AsRef<Path>, options: WriteOptions) -> Result<Self>
pub fn create(path: impl AsRef<Path>, options: WriteOptions) -> Result<Self>
Creates a logical writer. Select Ewf1Logical or Ewf2Logical explicitly.
Caller-authored catalogs and auxiliary file tables are rejected; this
builder owns those. The root has identifier 1 and an empty name.
Sourcepub fn create_sequential(
path: impl AsRef<Path>,
options: SequentialOptions,
) -> Result<Self>
pub fn create_sequential( path: impl AsRef<Path>, options: SequentialOptions, ) -> Result<Self>
Creates bounded sequential Lx01 output. source_size is the sum of all
file payload lengths. Catalog metadata remains in memory; one encoded
segment is retained as payload scratch. No checkpoint resume.
Sourcepub fn add_directory(
&mut self,
parent: u64,
metadata: LogicalEntryMetadata,
) -> Result<u64>
pub fn add_directory( &mut self, parent: u64, metadata: LogicalEntryMetadata, ) -> Result<u64>
Adds a directory beneath an existing directory and returns its identifier. Duplicate names are permitted: identifiers disambiguate them.
Sourcepub fn add_file(
&mut self,
parent: u64,
metadata: LogicalEntryMetadata,
size: u64,
input: &mut impl Read,
) -> Result<u64>
pub fn add_file( &mut self, parent: u64, metadata: LogicalEntryMetadata, size: u64, input: &mut impl Read, ) -> Result<u64>
Reads exactly size bytes, assigns extents, and computes MD5/SHA1.
Trailing input bytes are left unread, allowing bounded source streams.
Callers own snapshot consistency and source metadata collection.
Sourcepub fn add_file_with_progress(
&mut self,
parent: u64,
metadata: LogicalEntryMetadata,
size: u64,
input: &mut impl Read,
progress: impl FnMut(LogicalWriteProgress) -> ControlFlow<()>,
) -> Result<u64>
pub fn add_file_with_progress( &mut self, parent: u64, metadata: LogicalEntryMetadata, size: u64, input: &mut impl Read, progress: impl FnMut(LogicalWriteProgress) -> ControlFlow<()>, ) -> Result<u64>
Adds a file with cooperative cancellation between input/output buffers. Cancellation or an I/O error requires discarding this builder.
Sourcepub fn finish(self) -> Result<WriteResult>
pub fn finish(self) -> Result<WriteResult>
Publishes the completed image with the EWF writer’s normal durability rules.
Auto Trait Implementations§
impl Freeze for LogicalWriter
impl RefUnwindSafe for LogicalWriter
impl Send for LogicalWriter
impl Sync for LogicalWriter
impl Unpin for LogicalWriter
impl UnsafeUnpin for LogicalWriter
impl UnwindSafe for LogicalWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more