[][src]Struct gcode::Line

pub struct Line<'input, B: Buffers<'input> = DefaultBuffers> { /* fields omitted */ }

A single line, possibly containing some Comments or GCodes.

Methods

impl<'input, B: Buffers<'input>> Line<'input, B>[src]

pub fn gcodes(&self) -> &[GCode<B::Arguments>][src]

All GCodes in this line.

pub fn comments(&self) -> &[Comment<'input>][src]

All Comments in this line.

pub fn push_gcode(
    &mut self,
    gcode: GCode<B::Arguments>
) -> Result<(), CapacityError<GCode<B::Arguments>>>
[src]

Try to add another GCode to the line.

pub fn push_comment(
    &mut self,
    comment: Comment<'input>
) -> Result<(), CapacityError<Comment<'input>>>
[src]

Try to add a Comment to the line.

pub fn is_empty(&self) -> bool[src]

Does the Line contain anything at all?

pub fn line_number(&self) -> Option<Word>[src]

Try to get the line number, if there was one.

pub fn set_line_number<W: Into<Option<Word>>>(&mut self, line_number: W)[src]

pub fn span(&self) -> Span[src]

Get the Line's position in its source text.

Trait Implementations

impl<'input, B: Clone + Buffers<'input>> Clone for Line<'input, B> where
    B::Commands: Clone,
    B::Comments: Clone
[src]

impl<'input, B> Debug for Line<'input, B> where
    B: Buffers<'input>, 
[src]

impl<'input, B> Default for Line<'input, B> where
    B: Buffers<'input>,
    B::Commands: Default,
    B::Comments: Default
[src]

impl<'de, 'input, B: Buffers<'input>> Deserialize<'de> for Line<'input, B> where
    B::Commands: Deserialize<'de>,
    B::Comments: Deserialize<'de>, 
[src]

impl<'input, B: PartialEq + Buffers<'input>> PartialEq<Line<'input, B>> for Line<'input, B> where
    B::Commands: PartialEq,
    B::Comments: PartialEq
[src]

impl<'input, B: Buffers<'input>> Serialize for Line<'input, B> where
    B::Commands: Serialize,
    B::Comments: Serialize
[src]

impl<'input, B: Buffers<'input>> StructuralPartialEq for Line<'input, B>[src]

Auto Trait Implementations

impl<'input, B> RefUnwindSafe for Line<'input, B> where
    <B as Buffers<'input>>::Commands: RefUnwindSafe,
    <B as Buffers<'input>>::Comments: RefUnwindSafe

impl<'input, B> Send for Line<'input, B> where
    <B as Buffers<'input>>::Commands: Send,
    <B as Buffers<'input>>::Comments: Send

impl<'input, B> Sync for Line<'input, B> where
    <B as Buffers<'input>>::Commands: Sync,
    <B as Buffers<'input>>::Comments: Sync

impl<'input, B> Unpin for Line<'input, B> where
    <B as Buffers<'input>>::Commands: Unpin,
    <B as Buffers<'input>>::Comments: Unpin

impl<'input, B> UnwindSafe for Line<'input, B> where
    <B as Buffers<'input>>::Commands: UnwindSafe,
    <B as Buffers<'input>>::Comments: UnwindSafe

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[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.