Struct Plan

Source
pub struct Plan {
    pub items: Vec<Item>,
    pub renamed: Vec<Renamed>,
    pub rootless: Vec<PathBuf>,
    pub rejected: Vec<Failed>,
    pub covers_the_target_cannot_hold: usize,
    pub tags_the_target_cannot_hold: usize,
}
Expand description

Everything a copy would do, decided before anything is written.

Fields§

§items: Vec<Item>

The files to write, in a stable order.

§renamed: Vec<Renamed>

Every component the destination filesystem forced a change to.

§rootless: Vec<PathBuf>

Selected files sitting under no watched root, which therefore have no tree to keep. Reported rather than dropped, and rather than invented a place for.

§rejected: Vec<Failed>

Sources or requested companion folders that cannot be read or converted as requested. The caller must refuse these before writing.

§covers_the_target_cannot_hold: usize

Audio files being encoded whose embedded cover cannot follow them into the target format, because ffmpeg refuses to mux a picture stream into it — see transcode::Target::keeps_embedded_art. Counted rather than named: the loss is the same whichever file it happens to.

§tags_the_target_cannot_hold: usize

Audio files being encoded into a target whose tag format has no room for one of the tags they carry — see transcode::Target::tags_it_would_drop. In practice this is wav and its fixed legacy vocabulary; every other target takes an arbitrary key and never adds to this count.

Implementations§

Source§

impl Plan

Source

pub fn prepare_playlists( &mut self, catalog: &Catalog, tracks: &[Id], ) -> Result<usize, String>

Rewrites selected M3U/M3U8 companions and adds a selection M3U8.

Source playlists are read as UTF-8 and left untouched. Entries not in this plan (including remote URLs) are omitted; the returned count makes that narrowing visible. Paths refer to adapted names and converted extensions, relative to each destination playlist. The generated selection follows the caller’s track order.

Source§

impl Plan

Source

pub fn total_bytes(&self) -> u64

Bytes the copy would write.

Source

pub fn counts(&self) -> BTreeMap<ItemKind, usize>

How many files of each kind, for a report that says what it is copying.

Source§

impl Plan

How many files the plan would encode rather than copy.

Source

pub fn converted(&self) -> usize

Items that go through an encoder, and those that are copied as they are.

Reported separately because the difference is the one thing a user needs to see before a conversion starts: a library that is half MP3 already comes out half untouched, and a count that hid that would look like the conversion had silently skipped things.

Source

pub fn size_is_estimated(&self) -> bool

true when any size in the plan is an encoder’s output, and therefore a guess rather than a measurement.

Trait Implementations§

Source§

impl Clone for Plan

Source§

fn clone(&self) -> Plan

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Plan

Source§

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

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

impl Default for Plan

Source§

fn default() -> Plan

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Plan

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Plan

Source§

impl StructuralPartialEq for Plan

Auto Trait Implementations§

§

impl Freeze for Plan

§

impl RefUnwindSafe for Plan

§

impl Send for Plan

§

impl Sync for Plan

§

impl Unpin for Plan

§

impl UnwindSafe for Plan

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.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

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.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,