pub struct DiscWriter(/* private fields */);Expand description
A constructed disc writer.
This is the primary entry point for writing disc images.
Implementations§
Source§impl DiscWriter
impl DiscWriter
Sourcepub fn new(disc: DiscReader, options: &FormatOptions) -> Result<DiscWriter>
pub fn new(disc: DiscReader, options: &FormatOptions) -> Result<DiscWriter>
Creates a new disc writer with the specified format options.
Sourcepub fn process(
&self,
data_callback: impl FnMut(Bytes, u64, u64) -> Result<()>,
options: &ProcessOptions,
) -> Result<DiscFinalization>
pub fn process( &self, data_callback: impl FnMut(Bytes, u64, u64) -> Result<()>, options: &ProcessOptions, ) -> Result<DiscFinalization>
Processes the disc writer to completion, calling the data callback, in order, for each block of data to write to the output file. The callback should write all data before returning, or return an error if writing fails.
See DataCallback for more information.
Sourcepub fn progress_bound(&self) -> u64
pub fn progress_bound(&self) -> u64
Returns the progress upper bound for the disc writer. For most formats, this has no relation to the written disc size, but can be used to display progress.
Sourcepub fn weight(&self) -> DiscWriterWeight
pub fn weight(&self) -> DiscWriterWeight
Returns the weight of the disc writer, which can help determine the number of threads to dedicate for output processing. This may depend on the format’s configuration, such as whether compression is enabled.
Trait Implementations§
Source§impl Clone for DiscWriter
impl Clone for DiscWriter
Source§fn clone(&self) -> DiscWriter
fn clone(&self) -> DiscWriter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DiscWriter
impl !RefUnwindSafe for DiscWriter
impl !Send for DiscWriter
impl !Sync for DiscWriter
impl Unpin for DiscWriter
impl !UnwindSafe for DiscWriter
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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