pub struct Heredoc {
pub delimiter: Identifier,
pub template: String,
pub strip: HeredocStripMode,
}
Expand description
A heredoc template expression is introduced by a <<
sequence and defines a template via a
multi-line sequence terminated by a user-chosen delimiter.
Fields
delimiter: Identifier
The delimiter identifier that denotes the heredoc start and end.
template: String
The raw template contained in the heredoc.
strip: HeredocStripMode
The heredoc strip mode.
Implementations
sourceimpl Heredoc
impl Heredoc
sourcepub fn new<T>(delimiter: Identifier, template: T) -> Heredocwhere
T: Into<String>,
pub fn new<T>(delimiter: Identifier, template: T) -> Heredocwhere
T: Into<String>,
Creates a new Heredoc
with the provided delimiter and template body.
sourcepub fn with_strip_mode(self, strip: HeredocStripMode) -> Heredoc
pub fn with_strip_mode(self, strip: HeredocStripMode) -> Heredoc
Sets the heredoc strip mode to use on the template.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Heredoc
impl<'de> Deserialize<'de> for Heredoc
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<Heredoc> for TemplateExpr
impl From<Heredoc> for TemplateExpr
sourceimpl<'de> IntoDeserializer<'de, Error> for Heredoc
impl<'de> IntoDeserializer<'de, Error> for Heredoc
type Deserializer = MapAccessDeserializer<HeredocAccess>
type Deserializer = MapAccessDeserializer<HeredocAccess>
The type of the deserializer being converted into.
sourcefn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
impl Eq for Heredoc
impl StructuralEq for Heredoc
impl StructuralPartialEq for Heredoc
Auto Trait Implementations
impl RefUnwindSafe for Heredoc
impl Send for Heredoc
impl Sync for Heredoc
impl Unpin for Heredoc
impl UnwindSafe for Heredoc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.