pub trait Callbacks {
// Provided methods
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) { ... }
}Expand description
Callbacks used during the parsing process to indicate possible errors.
Provided Methods§
Sourcefn unknown_content(&mut self, _text: &str, _span: Span)
fn unknown_content(&mut self, _text: &str, _span: Span)
The parser encountered some text it wasn’t able to make sense of.
Sourcefn gcode_buffer_overflowed(
&mut self,
_mnemonic: Mnemonic,
_major_number: u32,
_minor_number: u32,
_arguments: &[Word],
_span: Span,
)
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.
Sourcefn gcode_argument_buffer_overflowed(
&mut self,
_mnemonic: Mnemonic,
_major_number: u32,
_minor_number: u32,
_argument: Word,
)
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.
Sourcefn comment_buffer_overflow(&mut self, _comment: Comment<'_>)
fn comment_buffer_overflow(&mut self, _comment: Comment<'_>)
A Comment was encountered, but there wasn’t enough room in
Buffers::Comments.
Sourcefn unexpected_line_number(&mut self, _line_number: f32, _span: Span)
fn unexpected_line_number(&mut self, _line_number: f32, _span: Span)
A line number was encountered when it wasn’t expected.
Sourcefn argument_without_a_command(
&mut self,
_letter: char,
_value: f32,
_span: Span,
)
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.
Sourcefn number_without_a_letter(&mut self, _value: &str, _span: Span)
fn number_without_a_letter(&mut self, _value: &str, _span: Span)
A Word’s number was encountered without an accompanying letter.
Sourcefn letter_without_a_number(&mut self, _value: &str, _span: Span)
fn letter_without_a_number(&mut self, _value: &str, _span: Span)
A Word’s letter was encountered without an accompanying number.