pub struct HereDoc {
pub delimiter: Word,
pub remove_tabs: bool,
pub content: OnceCell<Text>,
}Expand description
Here-document
Fields§
§delimiter: WordToken that marks the end of the content of the here-document
remove_tabs: boolWhether leading tab characters should be removed from each line of the here-document content
This value is true for the <<- operator and false for <<.
content: OnceCell<Text>Content of the here-document
The content ends with a newline unless it is empty. If the delimiter is
quoted, the content must be all literal. If remove_tabs is true,
each content line does not start with tabs as they are removed when
parsed.
This value is wrapped in OnceCell because the here-doc content is
parsed separately from the here-doc operator. When the operator is
parsed, the HereDoc instance is created with an empty content. The
content is filled to the cell when it is parsed later. When accessing
the parsed content, you can safely unwrap the cell.
Trait Implementations§
impl Eq for HereDoc
impl StructuralPartialEq for HereDoc
Auto Trait Implementations§
impl !Freeze for HereDoc
impl !RefUnwindSafe for HereDoc
impl !Send for HereDoc
impl !Sync for HereDoc
impl Unpin for HereDoc
impl !UnwindSafe for HereDoc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more