pub(crate) struct LiteralBlock<'a>(&'a str);Expand description
Text for a | block scalar.
Tuple Fields§
§0: &'a strImplementations§
Source§impl<'a> LiteralBlock<'a>
impl<'a> LiteralBlock<'a>
pub(crate) const fn new(text: &'a str) -> Self
Sourcepub(crate) fn is_representable(&self) -> bool
pub(crate) fn is_representable(&self) -> bool
Whether a block scalar reproduces the text exactly.
Control characters other than line feeds, and line separators, have
no faithful block form. A tab is fine inside a line but not at its
start. Text of only line feeds has none either. Empty text is |-
with no lines.
Sourcepub(super) fn header(&self) -> String
pub(super) fn header(&self) -> String
The header, such as |-, |+, or |2.
The indicator is needed when the first line is empty or starts with a space.
Content is written two columns deeper than the node that owns the scalar, so the indicator is always 2.
Sourcepub(super) fn lines(&self) -> impl Iterator<Item = &str>
pub(super) fn lines(&self) -> impl Iterator<Item = &str>
The content lines, followed by the empty lines that keep chomping needs.
fn trailing_newlines(&self) -> usize
Auto Trait Implementations§
impl<'a> Freeze for LiteralBlock<'a>
impl<'a> RefUnwindSafe for LiteralBlock<'a>
impl<'a> Send for LiteralBlock<'a>
impl<'a> Sync for LiteralBlock<'a>
impl<'a> Unpin for LiteralBlock<'a>
impl<'a> UnsafeUnpin for LiteralBlock<'a>
impl<'a> UnwindSafe for LiteralBlock<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more