[][src]Trait gcode::Callbacks

pub trait Callbacks {
    fn unknown_content(&mut self, _text: &str, _span: Span) { ... }
fn gcode_buffer_overflowed(
        &mut self,
        _mnemonic: Mnemonic,
        _major_number: u32,
        _minor_number: u32,
        _arguments: &[Word],
        _span: Span
    ) { ... }
fn gcode_argument_buffer_overflowed(
        &mut self,
        _mnemonic: Mnemonic,
        _major_number: u32,
        _minor_number: u32,
        _argument: Word
    ) { ... }
fn comment_buffer_overflow(&mut self, _comment: Comment) { ... }
fn unexpected_line_number(&mut self, _line_number: f32, _span: Span) { ... }
fn argument_without_a_command(
        &mut self,
        _letter: char,
        _value: f32,
        _span: Span
    ) { ... }
fn number_without_a_letter(&mut self, _value: &str, _span: Span) { ... }
fn letter_without_a_number(&mut self, _value: &str, _span: Span) { ... } }

Callbacks used during the parsing process to indicate possible errors.

Provided methods

fn unknown_content(&mut self, _text: &str, _span: Span)

The parser encountered some text it wasn't able to make sense of.

fn gcode_buffer_overflowed(
    &mut self,
    _mnemonic: Mnemonic,
    _major_number: u32,
    _minor_number: u32,
    _arguments: &[Word],
    _span: Span
)

The Buffers::Commands buffer had insufficient capacity when trying to add a GCode.

fn gcode_argument_buffer_overflowed(
    &mut self,
    _mnemonic: Mnemonic,
    _major_number: u32,
    _minor_number: u32,
    _argument: Word
)

The Buffers::Arguments buffer had insufficient capacity when trying to add a Word.

To aid in diagnostics, the caller is also given the GCode's mnemonic and major/minor numbers.

fn comment_buffer_overflow(&mut self, _comment: Comment)

A Comment was encountered, but there wasn't enough room in Buffers::Comments.

fn unexpected_line_number(&mut self, _line_number: f32, _span: Span)

A line number was encountered when it wasn't expected.

fn argument_without_a_command(
    &mut self,
    _letter: char,
    _value: f32,
    _span: Span
)

An argument was found, but the parser couldn't figure out which GCode it corresponds to.

fn number_without_a_letter(&mut self, _value: &str, _span: Span)

A Word's number was encountered without an accompanying letter.

fn letter_without_a_number(&mut self, _value: &str, _span: Span)

A Word's letter was encountered without an accompanying number.

Loading content...

Implementations on Foreign Types

impl<'a, C: Callbacks + ?Sized> Callbacks for &'a mut C[src]

Loading content...

Implementors

impl Callbacks for Nop[src]

Loading content...