summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorSerguey Parkhomovsky <xindigo@gmail.com>2026-03-17 20:37:39 -0700
committerSerguey Parkhomovsky <xindigo@gmail.com>2026-03-17 20:37:39 -0700
commitc113d9b5a0fb6c86773c5e98f1afd46ce29e1aad (patch)
tree08e6a8118beeb3e1b1394e8272417c56fed81376 /src/lib.rs
parent742277fff73cdb98a34558655c2d85ef44cb3ec3 (diff)
Restrict visibility of internal structs
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/lib.rs b/src/lib.rs
index aa05dd9..4891b42 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,7 +18,7 @@ pub struct PrinterState {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
-pub enum PrusaState {
+enum PrusaState {
Idle,
Printing,
Paused,
@@ -31,7 +31,7 @@ pub enum PrusaState {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
-pub enum BambuState {
+enum BambuState {
Idle,
Running,
Pause,
@@ -40,52 +40,52 @@ pub enum BambuState {
}
#[derive(Debug, Deserialize)]
-pub struct PrusaJob {
- pub id: u32,
- pub progress: f32,
- pub time_remaining: u32,
- pub time_printing: u32,
+struct PrusaJob {
+ id: u32,
+ progress: f32,
+ time_remaining: u32,
+ time_printing: u32,
}
#[derive(Debug, Deserialize)]
-pub struct PrusaPrinterInfo {
- pub state: PrusaState,
- pub temp_nozzle: f32,
- pub target_nozzle: f32,
- pub temp_bed: f32,
- pub target_bed: f32,
- pub axis_x: f32,
- pub axis_y: f32,
- pub axis_z: f32,
- pub flow: u32,
- pub speed: u32,
- pub fan_hotend: u32,
- pub fan_print: u32,
+struct PrusaPrinterInfo {
+ state: PrusaState,
+ temp_nozzle: f32,
+ target_nozzle: f32,
+ temp_bed: f32,
+ target_bed: f32,
+ axis_x: f32,
+ axis_y: f32,
+ axis_z: f32,
+ flow: u32,
+ speed: u32,
+ fan_hotend: u32,
+ fan_print: u32,
}
#[derive(Debug, Deserialize)]
pub struct PrusaStatus {
- pub job: Option<PrusaJob>,
- pub printer: PrusaPrinterInfo,
+ job: Option<PrusaJob>,
+ printer: PrusaPrinterInfo,
}
#[derive(Deserialize)]
-pub struct BambuPrintMessage {
- pub bed_target_temper: Option<f32>,
- pub bed_temper: Option<f32>,
- pub gcode_state: Option<BambuState>,
- pub layer_num: Option<u32>,
- pub mc_percent: Option<u32>,
- pub mc_remaining_time: Option<u32>,
- pub nozzle_target_temper: Option<f32>,
- pub nozzle_temper: Option<f32>,
- pub print_speed: Option<String>,
- pub total_layer_num: Option<u32>,
+struct BambuPrintMessage {
+ bed_target_temper: Option<f32>,
+ bed_temper: Option<f32>,
+ gcode_state: Option<BambuState>,
+ layer_num: Option<u32>,
+ mc_percent: Option<u32>,
+ mc_remaining_time: Option<u32>,
+ nozzle_target_temper: Option<f32>,
+ nozzle_temper: Option<f32>,
+ print_speed: Option<String>,
+ total_layer_num: Option<u32>,
}
#[derive(Deserialize)]
pub struct BambuStatus {
- pub print: Option<BambuPrintMessage>,
+ print: Option<BambuPrintMessage>,
}
#[derive(Debug, Deserialize)]