Expand description
printobserver-printer-api.
Owns: the port the physical printer speaks through — the trait for reading
printer and job state and for asking the machine to do one of the bounded
things the action vocabulary names, plus that port’s own error type — and
the printer domain’s vocabulary: the state a printer reports (state,
declared in printobserver-types and re-exported here), the closed set of
things an adjustment may change (adjustable), the snapshots those reads
answer (snapshot), what the printer knows of the files it holds and the
filament they use ([file]) and the plausibility ranges their reported
numbers are read against (ranges). A change to what a
printer reports edits this crate and the adapters behind it, and nothing
central.
May depend on: printobserver-types only. A port that named an
implementation would stop being a port.
§What this port does not expose
There is no method that accepts a command string, and that absence is the
contract rather than an omission: no method here admits a byte sequence at
all, and the only string anywhere in the closure reachable from a method’s
parameters is the one FileName wraps, which only
PrinterPort::start and the two reads of one file —
PrinterPort::file_facts and PrinterPort::extruded_to — take. Every value a method takes is already
bounded by the time it arrives: policy has ruled on it before it gets here.
§Why the methods answer a boxed future
Every method is asynchronous, and the trait is dyn-compatible and shareable
across threads, because the supervision core holds every port behind
Arc<dyn Port>. An async fn in a trait is not dyn-compatible, so each
method answers a BoxFuture instead: the same asynchrony, in the one
shape a trait object can carry.
Re-exports§
pub use adjustable::Adjustable;pub use adjustable::AdjustableError;pub use file::FileFacts;pub use file::FilePrint;pub use file::ToolFilament;pub use ranges::COMPLETION_RANGE;pub use ranges::FAN_PERCENT_RANGE;pub use ranges::FEEDRATE_FACTOR_RANGE;pub use ranges::FLOWRATE_FACTOR_RANGE;pub use ranges::HEATER_ACTUAL_C_RANGE;pub use ranges::HEATER_OFFSET_C_RANGE;pub use ranges::HEATER_TARGET_C_RANGE;pub use ranges::RANGED_FIELDS;pub use ranges::RangedField;pub use snapshot::HeaterSnapshot;pub use snapshot::JobSnapshot;pub use snapshot::PrinterSnapshot;
Modules§
- adjustable
- The closed set of things an adjustment may change.
- file
- What a printer knows of the files it holds, and of the filament they use.
- ranges
- The plausibility ranges the printer port declares for what a printer reports.
- snapshot
- Normalized observations of a printer and of the job it is running.
- state
- The state a source reports a printer or a print to be in.
Enums§
- Printer
Error - Why the printer did not do what it was asked.
- Printer
State - The state a source reports a printer or a print to be in.
Traits§
- Printer
Port - The port the physical printer speaks through.
Type Aliases§
- BoxFuture
- A future this port’s methods answer with, in the one shape a trait object can carry.