[−][src]Struct gcode::Gcode
A single gcode command.
Methods
impl Gcode
[src]
pub const MAX_ARGUMENT_COUNT: usize
[src]
The maximum number of arguments in a single Gcode
command when
compiled without the std
feature.
pub fn new(mnemonic: Mnemonic, number: f32) -> Gcode
[src]
pub fn mnemonic(&self) -> Mnemonic
[src]
The general command category.
pub fn major_number(&self) -> usize
[src]
Get the command's major number.
pub fn minor_number(&self) -> Option<usize>
[src]
Get the command's minor number, of there is one.
pub fn args(&self) -> &[Argument]
[src]
Access any arguments attached to this Gcode
.
pub fn args_mut(&mut self) -> &mut [Argument]
[src]
Mutably access the arguments attached to this Gcode
.
pub fn with_line_number(self, number: usize) -> Self
[src]
Set the line number.
pub fn with_minor_number(self, number: usize) -> Self
[src]
Set the minor number.
pub fn with_argument(self, arg: Argument) -> Self
[src]
Add an argument to the Gcode
, removing any previous arguments with
the same letter.
pub fn with_span(self, span: Span) -> Self
[src]
Set the Gcode
's Span
.
pub fn push_argument(&mut self, arg: Argument)
[src]
Add an argument to the Gcode
.
pub fn remove_argument(&mut self, letter: char) -> Option<Argument>
[src]
Remove the first argument with the specified letter
.
pub fn span(&self) -> Span
[src]
Get the Gcode
's location.
pub fn line_number(&self) -> Option<usize>
[src]
Get the Gcode
's line number, if one was provided.
pub fn value_for(&self, letter: char) -> Option<f32>
[src]
Get the value for a particular argument letter, if there is one.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,