[][src]Struct axon_parser::ast::Line

pub struct Line {
    pub indent: Indent,
    pub line: String,
}

Represents a line of Axon code, including the indentation at the start of the line.

Fields

indent: Indent

The indentation of the line (excluding the Axon code).

line: String

The remaining part of the line (excluding the indentation).

Implementations

impl Line[src]

pub fn new(indent: Indent, line: String) -> Self[src]

pub fn grouped(&self) -> Line[src]

Return a new line with parentheses added around it.

pub fn inner_str(&self) -> &str[src]

Return the contents of this line, excluding the indent.

pub fn indent(&self) -> &Indent[src]

Return the indent of this line.

pub fn prefix_str(&self, prefix: &str) -> Self[src]

Return a new line with the string prefixed to the start of the contents of this line.

pub fn suffix_str(&self, suffix: &str) -> Self[src]

Return a new line with the string suffixed to the end of the line.

pub fn len(&self) -> usize[src]

The number of characters in this line, including indentation.

Trait Implementations

impl Clone for Line[src]

impl Debug for Line[src]

impl Display for Line[src]

impl PartialEq<Line> for Line[src]

impl StructuralPartialEq for Line[src]

Auto Trait Implementations

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> ToString for T where
    T: Display + ?Sized
[src]

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.