pub struct Par2CreatePlan {Show 19 fields
pub base_path: PathBuf,
pub output_stem: PathBuf,
pub main_path: PathBuf,
pub volumes: Vec<RecoveryVolumePlan>,
pub volume_scheme: VolumeScheme,
pub volume_paths: Vec<PathBuf>,
pub output_paths: Vec<PathBuf>,
pub sources: Vec<CreationSource>,
pub slice_size: u64,
pub source_slice_count: u32,
pub recovery_count: u32,
pub first_exponent: RecoveryExponent,
pub recovery_exponents: Vec<RecoveryExponent>,
pub recovery_set_id: RecoverySetId,
pub forward_kernel: ForwardKernel,
pub backend: CreationBackend,
pub memory: Par2MemoryPlan,
pub dry_run: bool,
pub skipped_empty: Vec<PathBuf>,
/* private fields */
}Expand description
Fully validated creation inputs and deterministic output allocation.
Fields§
§base_path: PathBufCanonical base directory used for source resolution and packet names.
output_stem: PathBufCanonical output stem without the final par2 suffix.
main_path: PathBufMain critical-packet output path.
volumes: Vec<RecoveryVolumePlan>Recovery volume allocations, in increasing exponent order.
volume_scheme: VolumeSchemeRecovery volume sizing policy used for the allocation.
volume_paths: Vec<PathBuf>Recovery volume paths, matching the volume allocations.
output_paths: Vec<PathBuf>All output paths, with the main file first.
sources: Vec<CreationSource>Sources sorted by PAR2 file identifier, which is also encoder input order.
slice_size: u64Source slice size in bytes.
source_slice_count: u32Total number of source slices across all files.
recovery_count: u32Number of recovery slices.
first_exponent: RecoveryExponentExponent assigned to the first recovery slice.
recovery_exponents: Vec<RecoveryExponent>Recovery exponents in output order.
recovery_set_id: RecoverySetIdRecovery-set identifier from the Main packet body.
forward_kernel: ForwardKernelForward arithmetic path selected when this plan was built.
backend: CreationBackendCreation backend policy requested for this plan.
memory: Par2MemoryPlanMemory accounting for this plan.
dry_run: boolWhether the caller requested a write-free operation.
skipped_empty: Vec<PathBuf>Inputs excluded from the set because they are zero-length, in input order, as the caller spelled them.
A PAR2 set cannot describe an empty file (the format protects slices
and an empty file has none), so these inputs are not in sources, get
no packets, and are invisible to verify and repair. The reference
encoder makes the same exclusion and reports it unconditionally
(“Skipping 0 byte file”); callers that surface plans to a human should
do the same with this list, because a set that silently protects fewer
files than were listed reads as protection it does not provide.
Implementations§
Source§impl Par2CreatePlan
impl Par2CreatePlan
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Return the number of critical source files in the set.
Sourcepub fn volume_count(&self) -> usize
pub fn volume_count(&self) -> usize
Return the number of recovery volume files.
Trait Implementations§
Source§impl Clone for Par2CreatePlan
impl Clone for Par2CreatePlan
Source§fn clone(&self) -> Par2CreatePlan
fn clone(&self) -> Par2CreatePlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Par2CreatePlan
impl Debug for Par2CreatePlan
impl Eq for Par2CreatePlan
Source§impl PartialEq for Par2CreatePlan
impl PartialEq for Par2CreatePlan
impl StructuralPartialEq for Par2CreatePlan
Auto Trait Implementations§
impl Freeze for Par2CreatePlan
impl RefUnwindSafe for Par2CreatePlan
impl Send for Par2CreatePlan
impl Sync for Par2CreatePlan
impl Unpin for Par2CreatePlan
impl UnsafeUnpin for Par2CreatePlan
impl UnwindSafe for Par2CreatePlan
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