[][src]Struct gcode::GCode

pub struct GCode { /* fields omitted */ }

A single gcode command.

Methods

impl GCode[src]

pub const MAX_ARGUMENT_LEN: usize[src]

The maximum number of Words when compiled without the std feature.

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

pub fn mnemonic(&self) -> Mnemonic[src]

pub fn major_number(&self) -> u32[src]

pub fn minor_number(&self) -> u32[src]

pub fn arguments(&self) -> &[Word][src]

pub fn span(&self) -> Span[src]

pub fn push_argument(&mut self, arg: Word)[src]

Add an argument to the list of arguments attached to this GCode.

pub fn with_argument(self, arg: Word) -> Self[src]

The builder equivalent of GCode::push_argument().

pub fn value_for(&self, letter: char) -> Option<f32>[src]

Get the value for a particular argument.

Examples

let gcode = GCode::new(Mnemonic::General, 1.0, Span::PLACEHOLDER)
    .with_argument(Word::new('X', 30.0, Span::PLACEHOLDER))
    .with_argument(Word::new('Y', -3.14, Span::PLACEHOLDER));

assert_eq!(gcode.value_for('Y'), Some(-3.14));

Trait Implementations

impl Extend<Word> for GCode[src]

impl Clone for GCode[src]

impl PartialEq<GCode> for GCode[src]

impl Display for GCode[src]

impl Debug for GCode[src]

impl StructuralPartialEq for GCode[src]

impl Serialize for GCode[src]

impl<'de> Deserialize<'de> for GCode[src]

Auto Trait Implementations

impl Send for GCode

impl Sync for GCode

impl Unpin for GCode

impl UnwindSafe for GCode

impl RefUnwindSafe for GCode

Blanket Implementations

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

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]