pub struct SpoolRecord {Show 13 fields
pub id: SpoolId,
pub name: String,
pub material: String,
pub color: Option<String>,
pub diameter_mm: f64,
pub density_g_cm3: f64,
pub initial_g: f64,
pub remaining_g: f64,
pub tare_g: Option<f64>,
pub lifecycle: SpoolLifecycle,
pub trust: SpoolTrust,
pub registered_at: Timestamp,
pub updated_at: Timestamp,
}Expand description
One spool the operator registered, and what is known of it now.
Fields§
§id: SpoolIdThis spool’s identifier, minted when it was registered.
name: StringThe operator’s own label for the spool; never empty.
material: StringThe material, as given and trimmed, such as PLA; never empty.
color: Option<String>The filament’s colour, when the operator gave one.
diameter_mm: f64The filament’s diameter, in millimetres; above zero.
density_g_cm3: f64The material’s density, in grams per cubic centimetre; above zero.
initial_g: f64The net filament on the spool when it was full, in grams; above zero.
remaining_g: f64The filament left, in grams.
Always the initial figure less every charge plus every correction. A charge is never refused or clamped, so this may go below zero.
tare_g: Option<f64>The empty spool’s own weight, in grams, when the operator gave it.
lifecycle: SpoolLifecycleWhere the spool is in its life: on the shelf, loaded on a tool, or retired — and never both of the last two.
trust: SpoolTrustHow far the remaining figure can be trusted.
registered_at: TimestampWhen the spool was registered.
updated_at: TimestampWhen anything about the spool last changed.
Implementations§
Source§impl SpoolRecord
impl SpoolRecord
Sourcepub const fn loaded_tool(&self) -> Option<i64>
pub const fn loaded_tool(&self) -> Option<i64>
The tool the spool is loaded on, when it is loaded.
Sourcepub const fn is_retired(&self) -> bool
pub const fn is_retired(&self) -> bool
Whether the spool has been retired.
Trait Implementations§
Source§impl Clone for SpoolRecord
impl Clone for SpoolRecord
Source§impl Debug for SpoolRecord
impl Debug for SpoolRecord
Source§impl<'de> Deserialize<'de> for SpoolRecord
impl<'de> Deserialize<'de> for SpoolRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SpoolRecord
impl JsonSchema for SpoolRecord
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more