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§
- Active
Component 🔒 - State tracked per in-flight component so we can render both an
indicatifbar and, for byte-oriented transfers, a JSON-Lines subtask. - Channel
Reporter 🔒 - 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 asha256:-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
ProgressBytesschema 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.