Struct g_code::parse::ast::Line[][src]

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

A sequence of GCode that is either followed by a Newline or at the end of a file.

Implementations

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

pub fn iter_fields(&self) -> impl Iterator<Item = &Field<'input>>[src]

Iterate by Field in a line of GCode.

pub fn validate_checksum(&self) -> Option<Result<(), u8>>[src]

Validates Line::checksum against the fields that the line contains. If the line has no checksum, this will return Option::None.

If the line does have a checksum, this will return an empty Result::Ok or an Result::Err containing the computed checksum that differs from the actual.

pub fn iter_bytes(&self) -> impl Iterator<Item = &u8>[src]

Iterate over u8 in a Line.

pub fn compute_checksum(&self) -> u8[src]

XORs bytes in a Line leading up to the asterisk of a Checksum.

Trait Implementations

impl<'input> Clone for Line<'input>[src]

impl<'input> Debug for Line<'input>[src]

impl<'input> Eq for Line<'input>[src]

impl<'input> PartialEq<Line<'input>> for Line<'input>[src]

impl<'input> Spanned for Line<'input>[src]

impl<'input> StructuralEq for Line<'input>[src]

impl<'input> StructuralPartialEq for Line<'input>[src]

Auto Trait Implementations

impl<'input> RefUnwindSafe for Line<'input>

impl<'input> Send for Line<'input>

impl<'input> Sync for Line<'input>

impl<'input> Unpin for Line<'input>

impl<'input> UnwindSafe for Line<'input>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.