pub struct BuildState {
pub stages: Vec<StageState>,
pub current_stage: usize,
pub current_instruction: usize,
pub output_lines: Vec<OutputLine>,
pub scroll_offset: usize,
pub completed: bool,
pub error: Option<String>,
pub image_id: Option<String>,
pub total_stages: usize,
pub total_instructions: usize,
}Expand description
Internal build state tracking
Fields§
§stages: Vec<StageState>All stages in the build
current_stage: usizeCurrent stage index
current_instruction: usizeCurrent instruction index within the current stage
output_lines: Vec<OutputLine>Output lines from the build process
scroll_offset: usizeCurrent scroll offset for output
completed: boolWhether the build has completed
error: Option<String>Error message if build failed
image_id: Option<String>Final image ID if build succeeded
total_stages: usizeTotal stages pre-declared by the backend via BuildEvent::BuildStarted.
Populated once up-front. Used by current_stage_display so the
denominator is stable rather than growing as stages arrive.
0 means no backend pre-declaration was received; fall back to
stages.len() in that case.
total_instructions: usizeTotal instructions pre-declared by the backend via
BuildEvent::BuildStarted.
Populated once up-front. Used by total_instructions so the
progress-bar denominator is stable rather than growing as
InstructionStarted events arrive. 0 means no backend
pre-declaration was received; fall back to the event-sum.
Implementations§
Source§impl BuildState
impl BuildState
Sourcepub fn total_instructions(&self) -> usize
pub fn total_instructions(&self) -> usize
Get the total number of instructions across all stages.
Prefers the pre-declared total from BuildEvent::BuildStarted
(so the progress-bar denominator is stable); falls back to
summing the stages we’ve learned about so far for older tests
or backends that don’t emit BuildStarted.
Sourcepub fn completed_instructions(&self) -> usize
pub fn completed_instructions(&self) -> usize
Get the number of completed instructions across all stages
Sourcepub fn current_stage_display(&self) -> String
pub fn current_stage_display(&self) -> String
Get a display string for the current stage
Trait Implementations§
Source§impl Debug for BuildState
impl Debug for BuildState
Source§impl Default for BuildState
impl Default for BuildState
Source§fn default() -> BuildState
fn default() -> BuildState
Auto Trait Implementations§
impl Freeze for BuildState
impl RefUnwindSafe for BuildState
impl Send for BuildState
impl Sync for BuildState
impl Unpin for BuildState
impl UnsafeUnpin for BuildState
impl UnwindSafe for BuildState
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> 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