Skip to main content

Par2CreatePlan

Struct Par2CreatePlan 

Source
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: PathBuf

Canonical base directory used for source resolution and packet names.

§output_stem: PathBuf

Canonical output stem without the final par2 suffix.

§main_path: PathBuf

Main critical-packet output path.

§volumes: Vec<RecoveryVolumePlan>

Recovery volume allocations, in increasing exponent order.

§volume_scheme: VolumeScheme

Recovery 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: u64

Source slice size in bytes.

§source_slice_count: u32

Total number of source slices across all files.

§recovery_count: u32

Number of recovery slices.

§first_exponent: RecoveryExponent

Exponent assigned to the first recovery slice.

§recovery_exponents: Vec<RecoveryExponent>

Recovery exponents in output order.

§recovery_set_id: RecoverySetId

Recovery-set identifier from the Main packet body.

§forward_kernel: ForwardKernel

Forward arithmetic path selected when this plan was built.

§backend: CreationBackend

Creation backend policy requested for this plan.

§memory: Par2MemoryPlan

Memory accounting for this plan.

§dry_run: bool

Whether 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

Source

pub fn file_count(&self) -> usize

Return the number of critical source files in the set.

Source

pub fn volume_count(&self) -> usize

Return the number of recovery volume files.

Trait Implementations§

Source§

impl Clone for Par2CreatePlan

Source§

fn clone(&self) -> Par2CreatePlan

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Par2CreatePlan

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Par2CreatePlan

Source§

impl PartialEq for Par2CreatePlan

Source§

fn eq(&self, other: &Par2CreatePlan) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Par2CreatePlan

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more