Skip to main content

PrinterPort

Trait PrinterPort 

Source
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§

Source

fn snapshot(&self) -> BoxFuture<'_, Result<PrinterSnapshot, PrinterError>>

Read the printer’s current state.

Source

fn job(&self) -> BoxFuture<'_, Result<JobSnapshot, PrinterError>>

Read the job the printer reports it is running.

Source

fn start(&self, file_name: FileName) -> BoxFuture<'_, Result<(), PrinterError>>

Start a print of a named file.

Source

fn pause(&self) -> BoxFuture<'_, Result<(), PrinterError>>

Pause the print.

Source

fn resume(&self) -> BoxFuture<'_, Result<(), PrinterError>>

Resume the print.

Source

fn cancel(&self) -> BoxFuture<'_, Result<(), PrinterError>>

Cancel the print.

Source

fn set_feedrate_factor( &self, factor: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>

Set the feedrate multiplier, where one means one hundred percent.

Source

fn set_flowrate_factor( &self, factor: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>

Set the flowrate multiplier, where one means one hundred percent.

Source

fn set_tool_target_c( &self, tool: i64, target_c: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>

Set one tool’s target temperature, in degrees Celsius.

Source

fn set_bed_target_c( &self, target_c: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>

Set the bed’s target temperature, in degrees Celsius.

Source

fn set_fan_percent( &self, percent: f64, ) -> BoxFuture<'_, Result<(), PrinterError>>

Set the part-cooling fan, in percent.

Provided Methods§

Source

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.

Source

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.

Source

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".

Implementors§