pub struct Gcode { /* private fields */ }
Expand description
A single command in the gcode
programming language.
Implementations
sourceimpl Gcode
impl Gcode
sourcepub fn line_number(&self) -> Option<u32>
pub fn line_number(&self) -> Option<u32>
Get the line number given to this gode (e.g. the 20
in N20 G04 P100
).
sourcepub fn number(&self) -> f32
👎Deprecated: You probably want the Gcode::major_number()
and Gcode::minor_number()
methods instead
pub fn number(&self) -> f32
Gcode::major_number()
and Gcode::minor_number()
methods insteadThe number associated with this Gcode
(e.g. the 01
in G01 X123
).
sourcepub fn major_number(&self) -> u32
pub fn major_number(&self) -> u32
The integral part of the Gcode
’s number field.
sourcepub fn minor_number(&self) -> Option<u32>
pub fn minor_number(&self) -> Option<u32>
The first digit after the decimal point, if there was one.
Note
For all intents and purposes, a gcode like G1.0
doesn’t really have
a minor number.
sourcepub fn add_argument(&mut self, arg: Word)
pub fn add_argument(&mut self, arg: Word)
Add an argument to this Gcode
’s argument list.
sourcepub fn with_argument(self, arg: Word) -> Self
pub fn with_argument(self, arg: Word) -> Self
A builder method for adding an argument to the Gcode
.
sourcepub fn with_line_number(self, number: u32, span: Span) -> Self
pub fn with_line_number(self, number: u32, span: Span) -> Self
A builder method for attaching a line number (the 30
in N30 G01 X32
)
to a command.
Trait Implementations
impl StructuralPartialEq for Gcode
Auto Trait Implementations
impl RefUnwindSafe for Gcode
impl Send for Gcode
impl Sync for Gcode
impl Unpin for Gcode
impl UnwindSafe for Gcode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more