pub trait PrinterPort: Send + Sync {
Show 14 methods
// Required methods
fn snapshot(&self) -> BoxFuture<'_, Result<PrinterSnapshot, PrinterError>>;
fn job(&self) -> BoxFuture<'_, Result<JobSnapshot, PrinterError>>;
fn start(
&self,
file_name: FileName,
) -> BoxFuture<'_, Result<(), PrinterError>>;
fn pause(&self) -> BoxFuture<'_, Result<(), PrinterError>>;
fn resume(&self) -> BoxFuture<'_, Result<(), PrinterError>>;
fn cancel(&self) -> BoxFuture<'_, Result<(), PrinterError>>;
fn set_feedrate_factor(
&self,
factor: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>;
fn set_flowrate_factor(
&self,
factor: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>;
fn set_tool_target_c(
&self,
tool: i64,
target_c: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>;
fn set_bed_target_c(
&self,
target_c: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>;
fn set_fan_percent(
&self,
percent: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>;
// Provided methods
fn file_facts(
&self,
file_name: FileName,
) -> BoxFuture<'_, Result<FileFacts, PrinterError>> { ... }
fn printed_files(
&self,
) -> BoxFuture<'_, Result<Vec<FileFacts>, PrinterError>> { ... }
fn extruded_to(
&self,
file_name: FileName,
position_bytes: i64,
) -> BoxFuture<'_, Result<Vec<ToolFilament>, PrinterError>> { ... }
}Expand description
The port the physical printer speaks through.
Every method is asynchronous, the trait is dyn-compatible, and it is
shareable across threads, because the supervision core holds it behind
Arc<dyn PrinterPort>.
Required Methods§
Sourcefn snapshot(&self) -> BoxFuture<'_, Result<PrinterSnapshot, PrinterError>>
fn snapshot(&self) -> BoxFuture<'_, Result<PrinterSnapshot, PrinterError>>
Read the printer’s current state.
Sourcefn job(&self) -> BoxFuture<'_, Result<JobSnapshot, PrinterError>>
fn job(&self) -> BoxFuture<'_, Result<JobSnapshot, PrinterError>>
Read the job the printer reports it is running.
Sourcefn start(&self, file_name: FileName) -> BoxFuture<'_, Result<(), PrinterError>>
fn start(&self, file_name: FileName) -> BoxFuture<'_, Result<(), PrinterError>>
Start a print of a named file.
Sourcefn set_feedrate_factor(
&self,
factor: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>
fn set_feedrate_factor( &self, factor: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>
Set the feedrate multiplier, where one means one hundred percent.
Sourcefn set_flowrate_factor(
&self,
factor: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>
fn set_flowrate_factor( &self, factor: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>
Set the flowrate multiplier, where one means one hundred percent.
Sourcefn set_tool_target_c(
&self,
tool: i64,
target_c: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>
fn set_tool_target_c( &self, tool: i64, target_c: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>
Set one tool’s target temperature, in degrees Celsius.
Sourcefn set_bed_target_c(
&self,
target_c: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>
fn set_bed_target_c( &self, target_c: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>
Set the bed’s target temperature, in degrees Celsius.
Sourcefn set_fan_percent(
&self,
percent: f64,
) -> BoxFuture<'_, Result<(), PrinterError>>
fn set_fan_percent( &self, percent: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>
Set the part-cooling fan, in percent.
Provided Methods§
Sourcefn file_facts(
&self,
file_name: FileName,
) -> BoxFuture<'_, Result<FileFacts, PrinterError>>
fn file_facts( &self, file_name: FileName, ) -> BoxFuture<'_, Result<FileFacts, PrinterError>>
Read what the printer knows of one file it holds.
A printer that cannot answer is refused with status 501, which is what an implementation that does not override this answers.
Sourcefn printed_files(&self) -> BoxFuture<'_, Result<Vec<FileFacts>, PrinterError>>
fn printed_files(&self) -> BoxFuture<'_, Result<Vec<FileFacts>, PrinterError>>
Read every file the printer holds that carries a print tally.
A printer that cannot answer is refused with status 501, which is what an implementation that does not override this answers.
Sourcefn extruded_to(
&self,
file_name: FileName,
position_bytes: i64,
) -> BoxFuture<'_, Result<Vec<ToolFilament>, PrinterError>>
fn extruded_to( &self, file_name: FileName, position_bytes: i64, ) -> BoxFuture<'_, Result<Vec<ToolFilament>, PrinterError>>
Read the filament each tool is fed by one file’s own moves, from its start up to a byte position in it.
A printer that cannot answer is refused with status 501, which is what an implementation that does not override this answers.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".