Skip to main content

LogicalWriter

Struct LogicalWriter 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn finish(self) -> Result<WriteResult>

Publishes the completed image with the EWF writer’s normal durability rules.

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.