[][src]Struct gcode::Block

pub struct Block<'input> { /* fields omitted */ }

A block containing Gcode commands and/or comments.

Methods

impl<'input> Block<'input>[src]

pub const MAX_COMMAND_COUNT: usize[src]

The maximum number of Gcode commands which can be in a Block when compiled without the std feature.

Each Block can contain 16 Gcodes.

pub const MAX_COMMENT_COUNT: usize[src]

The maximum number of Comments which can be in a Block when compiled without the std feature.

Each Block can contain 4 Comments.

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 Gcodes in this block.

pub fn commands_mut(&mut self) -> &mut [Gcode][src]

Get a mutable reference to the Gcodes 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]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'input> Send for Block<'input>

impl<'input> Sync for Block<'input>

Blanket Implementations

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> From for T[src]

impl<T, U> TryInto 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, U> Into for T where
    U: From<T>, 
[src]

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

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

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