Skip to main content

ImportActionPlan

Struct ImportActionPlan 

Source
pub struct ImportActionPlan {
    pub actions: Vec<(ImportCandidate, ImportDecision)>,
    pub counts: PlanCounts,
    pub streaming_recommended: Option<bool>,
    pub album: Option<ResolvedAlbum>,
}
Expand description

Output of Phase 2 (plan).

Fields§

§actions: Vec<(ImportCandidate, ImportDecision)>§counts: PlanCounts§streaming_recommended: Option<bool>

The free-space probe’s streaming recommendation, attached at confirmation by attach_streaming_recommendation — never by the pure planner (the probe is I/O). None until attached; Some(true) means the library volume is near/over full for this plan’s total_size and the user should confirm a streaming import. Recording it on the plan (like the resolved destination album_id) keeps the planner deterministic.

§album: Option<ResolvedAlbum>

The destination album and which resolution rule chose it (SSoT: organization § The Default Album), so a surprising destination is explainable after the fact.

None when ImportConfig::album was still unbound at plan time — the library’s derived de facto album (rule 3) is the workspace’s to supply, and the executor binds it and runs the same resolve_default_album before writing anything. There is one resolution policy, never two.

Implementations§

Source§

impl ImportActionPlan

Source

pub fn import_candidate_sizes(&self) -> Vec<u64>

Per-Import-candidate source-byte sizes, largest first — the input to the streaming minimum-headroom check (the largest single asset must fully materialize locally). Skip decisions contribute nothing.

Source

pub fn largest_import_size(&self) -> u64

The largest single Import candidate’s size, or 0 when nothing will be imported.

Source

pub fn attach_streaming_recommendation( &mut self, library_root: &Path, headroom_margin: u64, ) -> Result<bool, LibraryError>

Attach the free-space probe’s streaming recommendation at confirmation: probe library_root’s available bytes (I/O — never inside the pure planner) and set streaming_recommended from the pure streaming_recommended predicate over this plan’s total_size. Returns the attached verdict.

Source

pub fn set_streaming_recommendation( &mut self, available: u64, headroom_margin: u64, ) -> bool

The pure half of attach_streaming_recommendation, taking an already-probed available so the auto-detect verdict is unit-testable without touching a real volume. Sets and returns streaming_recommended.

Source

pub fn confirm_upload_policy( &self, policy: UploadPolicy, use_streaming: bool, ) -> Result<(), StagedStreamingConflict>

Confirmation-time upload-policy gate (staged uploads).

A UploadPolicy::Staged run and a streaming import are mutually exclusive per import (transfer upload doc): streaming exists to release local bytes quickly, staged defers exactly the T2 upload release depends on. This is the planner’s single rejection point — call it at confirmation with the run’s policy and whether a streaming import was chosen (use_streaming); a conflicting combination returns StagedStreamingConflict instead of ever entering the executor. Delegates to the pure ensure_streaming_compatible invariant so the rule lives in one place.

Trait Implementations§

Source§

impl Debug for ImportActionPlan

Source§

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

Formats the value using the given formatter. Read more

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = 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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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