pub enum Model {
A1Mini,
A1,
P1P,
P1S,
X1,
X1Carbon,
X1E,
H2D,
Unknown(String),
}Expand description
A Bambu Lab printer model.
Variants§
A1Mini
A1
P1P
P1S
X1
X1Carbon
X1E
H2D
Unknown(String)
A model name/code we don’t recognise, kept verbatim.
Implementations§
Source§impl Model
impl Model
Sourcepub fn from_config_str(s: &str) -> Self
pub fn from_config_str(s: &str) -> Self
Parse a user-facing config model name (case-insensitive, ignoring spaces,
hyphens and underscores), e.g. "a1mini", "A1 mini", "x1c".
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
The canonical config name (round-trips through Model::from_config_str).
Sourcepub fn is_known(&self) -> bool
pub fn is_known(&self) -> bool
Whether this is a recognised model (not Model::Unknown).
Sourcepub fn from_device_code(code: &str) -> Self
pub fn from_device_code(code: &str) -> Self
Resolve a device-reported model code to a Model.
These are the vendor-canonical codes from Bambu’s own slicer machine
list (BambuStudio/resources/printers/<code>.json model_id), which for
the A1 family also match what the printer broadcasts over SSDP. We treat
the mapping as fact (vendor source); we do not copy the profile
contents. The A1 mini ↔ "N1" mapping is additionally hardware-observed
on a real unit (2026-06-13) — note that the once-“common” N2S = A1 mini
belief is inverted; N1 is the A1 mini and N2S is the full-size A1.
The legacy SSDP strings "3DPrinter-X1-Carbon" / "3DPrinter-X1" are
accepted and normalised to the modern BL-P001 / BL-P002 models.
Sourcepub fn device_code(&self) -> Option<&'static str>
pub fn device_code(&self) -> Option<&'static str>
The canonical device code for this model (round-trips through
Model::from_device_code); None for Model::Unknown.
Trait Implementations§
impl Eq for Model
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.