[][src]Struct dockerfile_parser::BreakableString

pub struct BreakableString {
    pub span: Span,
    pub components: Vec<BreakableStringComponent>,
}

A Docker string that may be broken across several lines, separated by line continuations (\\\n), and possibly intermixed with comments.

These strings have several potentially valid interpretations. As these line continuations match those natively supported by bash, a given multiline RUN block can be pasted into a bash shell unaltered and with line continuations included. However, at "runtime" line continuations and comments (*) are stripped from the string handed to the shell.

To ensure output is correct in all cases, BreakableString preserves the user's original AST, including comments, and implements Docker's continuation-stripping behavior in the Display implementation.

Fields

span: Spancomponents: Vec<BreakableStringComponent>

Implementations

impl BreakableString[src]

pub fn new(span: impl Into<Span>) -> Self[src]

pub fn add(self, c: impl Into<BreakableStringComponent>) -> Self[src]

pub fn add_string(self, s: impl Into<Span>, c: impl Into<String>) -> Self[src]

pub fn add_comment(self, s: impl Into<Span>, c: impl Into<String>) -> Self[src]

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

Trait Implementations

impl Clone for BreakableString[src]

impl Debug for BreakableString[src]

impl Display for BreakableString[src]

Formats this breakable string as it will be interpreted by the underlying Docker engine, i.e. on a single line with line continuations removed

impl Eq for BreakableString[src]

impl<'_> From<((usize, usize), &'_ str)> for BreakableString[src]

impl Ord for BreakableString[src]

impl PartialEq<BreakableString> for BreakableString[src]

impl PartialOrd<BreakableString> for BreakableString[src]

impl StructuralEq for BreakableString[src]

impl StructuralPartialEq for BreakableString[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.