pub struct Command<'a> { /* private fields */ }Expand description
Commands are the operational unit of g-code
They consist of a G, M, or other top-level field followed by field arguments
Implementations§
source§impl<'a> Command<'a>
impl<'a> Command<'a>
sourcepub fn push(&mut self, arg: Field<'a>) -> Result<(), &'static str>
pub fn push(&mut self, arg: Field<'a>) -> Result<(), &'static str>
Add a field to the command.
Returns Err if the Field’s letters aren’t recognized.
sourcepub fn iter(&self) -> impl Iterator<Item = &Field<'_>>
pub fn iter(&self) -> impl Iterator<Item = &Field<'_>>
Iterate over all fields including the command’s name (i.e. G0 for rapid positioning)
sourcepub fn into_token_vec(self) -> Vec<Token<'a>>
pub fn into_token_vec(self) -> Vec<Token<'a>>
Consumes the command to produce tokens suitable for output
sourcepub fn iter_args(&self) -> impl Iterator<Item = &Field<'_>>
pub fn iter_args(&self) -> impl Iterator<Item = &Field<'_>>
Iterate over the fields after the command’s name