pub(crate) struct Text(String);Expand description
A piece of the original source, kept verbatim.
Tuple Fields§
§0: StringImplementations§
Source§impl Text
impl Text
pub(crate) const fn is_empty(&self) -> bool
pub(crate) const fn as_str(&self) -> &str
pub(crate) fn append(&mut self, other: &Self)
Sourcepub(crate) fn terminate(&mut self)
pub(crate) fn terminate(&mut self)
End the text with a line break, adding one when it is missing.
Sourcepub(crate) fn comment_start(line: &str) -> Option<usize>
pub(crate) fn comment_start(line: &str) -> Option<usize>
Where the whitespace before the first comment in line starts. A
comment is a # at the start or after a space or tab.
Sourcepub(crate) fn comment_in(line: &str) -> Option<&str>
pub(crate) fn comment_in(line: &str) -> Option<&str>
The comment at the end of line, with the whitespace before it.
Sourcepub(crate) fn take_before_comment_block(&mut self) -> Self
pub(crate) fn take_before_comment_block(&mut self) -> Self
Split off what comes before the comment block that ends this text. The block is the run of comment lines at the end with no blank line between them. Returns the part before it and keeps the block.
Trait Implementations§
impl Eq for Text
impl StructuralPartialEq for Text
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnsafeUnpin for Text
impl UnwindSafe for Text
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.