Struct gcode::Gcode

source ·
pub struct Gcode { /* private fields */ }
Expand description

A single command in the gcode programming language.

Implementations

Create a new Gcode.

Get the Mnemonic used by this Gcode.

Get the location of this Gcode in the original text.

The arguments provided to the Gcode.

Get the line number given to this gode (e.g. the 20 in N20 G04 P100).

👎Deprecated: You probably want the Gcode::major_number() and Gcode::minor_number() methods instead

The number associated with this Gcode (e.g. the 01 in G01 X123).

The integral part of the Gcode’s number field.

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.

Add an argument to this Gcode’s argument list.

A builder method for adding an argument to the Gcode.

A builder method for attaching a line number (the 30 in N30 G01 X32) to a command.

Find the value for the desired argument.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.