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
impl ImportActionPlan
Sourcepub fn import_candidate_sizes(&self) -> Vec<u64>
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.
Sourcepub fn largest_import_size(&self) -> u64
pub fn largest_import_size(&self) -> u64
The largest single Import candidate’s size, or 0 when nothing will be imported.
Sourcepub fn attach_streaming_recommendation(
&mut self,
library_root: &Path,
headroom_margin: u64,
) -> Result<bool, LibraryError>
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.
Sourcepub fn set_streaming_recommendation(
&mut self,
available: u64,
headroom_margin: u64,
) -> bool
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.
Sourcepub fn confirm_upload_policy(
&self,
policy: UploadPolicy,
use_streaming: bool,
) -> Result<(), StagedStreamingConflict>
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§
Auto Trait Implementations§
impl Freeze for ImportActionPlan
impl RefUnwindSafe for ImportActionPlan
impl Send for ImportActionPlan
impl Sync for ImportActionPlan
impl Unpin for ImportActionPlan
impl UnsafeUnpin for ImportActionPlan
impl UnwindSafe for ImportActionPlan
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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