[−][src]Struct gcode::Block
A block containing Gcode
commands and/or comments.
Methods
impl<'input> Block<'input>
[src]
pub const MAX_COMMAND_COUNT: usize
[src]
pub const MAX_COMMENT_COUNT: usize
[src]
pub fn is_empty(&self) -> bool
[src]
Is this block empty?
pub fn into_commands(self) -> impl Iterator<Item = Gcode>
[src]
Convert this Block
into a stream of Gcode
commands.
pub fn commands(&self) -> &[Gcode]
[src]
The Gcode
s in this block.
pub fn commands_mut(&mut self) -> &mut [Gcode]
[src]
Get a mutable reference to the Gcode
s in this block.
pub fn comments(&self) -> &[Comment<'input>]
[src]
The comments in this block.
pub fn span(&self) -> Span
[src]
The block's location.
pub fn line_number(&self) -> Option<usize>
[src]
The block's line number (e.g. N42
), if provided.
pub fn with_line_number(&mut self, number: usize, span: Span) -> &mut Self
[src]
Set the Block
's line number.
pub fn deleted(&self) -> bool
[src]
Does this block start with a block delete?
pub fn delete(&mut self, delete: bool)
[src]
Set the block delete flag.
pub fn push_comment(&mut self, comment: Comment<'input>)
[src]
Add a Comment
to the Block
.
pub fn push_command(&mut self, command: Gcode)
[src]
Add a Gcode
to the Block
.
Trait Implementations
impl<'input> Debug for Block<'input>
[src]
impl<'input> PartialEq<Block<'input>> for Block<'input>
[src]
impl<'input> Clone for Block<'input>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,