[][src]Struct gcode::Gcode

pub struct Gcode { /* fields omitted */ }

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.

Each Gcode can contain 16 Arguments.

pub fn new(mnemonic: Mnemonic, number: f32) -> Gcode[src]

Create a new Gcode.

Panics

A negative number is invalid.

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

impl Debug for Gcode[src]

impl PartialEq<Gcode> for Gcode[src]

impl Clone for Gcode[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Gcode

impl Sync for Gcode

Blanket Implementations

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> From for T[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]