#[non_exhaustive]pub struct PrinterProfile {
pub name: String,
pub kind: PrinterKind,
pub wear: WearProfile,
}Expand description
A reusable printer definition, saved under ~/.config/printcalc/printers/
and referenced from jobs by name (or embedded directly).
#[non_exhaustive]: build one with PrinterProfile::new or parse
one from TOML. Fields stay public to read and assign.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringAlso the filename stem it’s saved under.
kind: PrinterKindFDM or resin.
wear: WearProfileDepreciation and running-cost inputs — flattened, so its keys sit
at the profile’s top level in TOML (no [wear] table).
Implementations§
Source§impl PrinterProfile
impl PrinterProfile
Sourcepub fn new(
name: impl Into<String>,
kind: PrinterKind,
wear: WearProfile,
) -> Self
pub fn new( name: impl Into<String>, kind: PrinterKind, wear: WearProfile, ) -> Self
Builds a profile from its parts.
Trait Implementations§
Source§impl Clone for PrinterProfile
impl Clone for PrinterProfile
Source§impl Debug for PrinterProfile
impl Debug for PrinterProfile
Source§impl<'de> Deserialize<'de> for PrinterProfile
impl<'de> Deserialize<'de> for PrinterProfile
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PrinterProfile
impl PartialEq for PrinterProfile
Source§impl Serialize for PrinterProfile
impl Serialize for PrinterProfile
impl StructuralPartialEq for PrinterProfile
Auto Trait Implementations§
impl Freeze for PrinterProfile
impl RefUnwindSafe for PrinterProfile
impl Send for PrinterProfile
impl Sync for PrinterProfile
impl Unpin for PrinterProfile
impl UnsafeUnpin for PrinterProfile
impl UnwindSafe for PrinterProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more