[−][src]Struct dockerfile_parser::BreakableString
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: Span
components: 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]
fn clone(&self) -> BreakableString
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn cmp(&self, other: &BreakableString) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<BreakableString> for BreakableString
[src]
fn eq(&self, other: &BreakableString) -> bool
[src]
fn ne(&self, other: &BreakableString) -> bool
[src]
impl PartialOrd<BreakableString> for BreakableString
[src]
fn partial_cmp(&self, other: &BreakableString) -> Option<Ordering>
[src]
fn lt(&self, other: &BreakableString) -> bool
[src]
fn le(&self, other: &BreakableString) -> bool
[src]
fn gt(&self, other: &BreakableString) -> bool
[src]
fn ge(&self, other: &BreakableString) -> bool
[src]
impl StructuralEq for BreakableString
[src]
impl StructuralPartialEq for BreakableString
[src]
Auto Trait Implementations
impl RefUnwindSafe for BreakableString
impl Send for BreakableString
impl Sync for BreakableString
impl Unpin for BreakableString
impl UnwindSafe for BreakableString
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,