Skip to main content

Module progress

Module progress 

Source
Expand description

Bridge composefs-rs’s [ProgressReporter] callback API to bootc’s own progress infrastructure (interactive indicatif bars and the --progress-fd JSON-Lines protocol).

composefs-rs (composefs::progress) reports progress via a synchronous, Send + Sync callback trait invoked directly from whatever task is driving the pull. That’s a poor fit for crate::progress_jsonl::ProgressWriter, whose API is async. We bridge the two by handing composefs-rs a trivial reporter that forwards every [ProgressEvent] over an unbounded channel, and processing that channel from a concurrently spawned Tokio task which owns the indicatif state and the ProgressWriter. This mirrors the existing ostree pull progress plumbing in crate::deploy (see handle_layer_progress_print), which is channel-based for the same reason.

Structs§

ActiveComponent 🔒
State tracked per in-flight component so we can render both an indicatif bar and, for byte-oriented transfers, a JSON-Lines subtask.
ChannelReporter 🔒
Forwards [ProgressEvent]s from composefs-rs’s synchronous callback onto an unbounded channel for asynchronous processing.

Constants§

ID_DISPLAY_LEN 🔒
Number of leading characters of a [ComponentId] (typically a sha256:-prefixed layer digest) to show in terminal output.

Functions§

bar_style 🔒
drive_progress 🔒
Background task consuming [ProgressEvent]s and updating both the interactive terminal display and the JSON-Lines progress writer.
json_subtasks 🔒
Rebuild the JSON-Lines subtask list from the currently in-flight byte-oriented components (composefs-rs does not expose object-count progress in a form the ProgressBytes schema can represent, so [ProgressUnit::Items] components only drive the terminal UI).
short_id 🔒
Truncate a [ComponentId] for compact display.
spawn 🔒
Start bridging composefs-rs progress events into bootc’s UI.