Struct ecmascript::ast::TemplateElement [−][src]
pub struct TemplateElement { pub cooked: Option<String>, pub raw: String, pub loc: Option<SourceLocation>, }
TemplateElement is any text between interpolated expressions inside a template literal.
eg. abc ${} \u{2028}
"abc " and " \u{2028}" would be the TemplateElements for this template literal.
Reference
Fields
cooked: Option<String>
If the template element has any sort of escape sequences (eg. \u{2028}) this will represent the evaluated result of that sequence. eg. if raw == "\u{41}", cooked = "A"
raw: String
This will store the exact string value, before being evaluted into the unicode code points.
loc: Option<SourceLocation>
This is the source location of the template element
Trait Implementations
impl Debug for TemplateElement
[src]
impl Debug for TemplateElement
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for TemplateElement
[src]
impl Clone for TemplateElement
fn clone(&self) -> TemplateElement
[src]
fn clone(&self) -> TemplateElement
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for TemplateElement
[src]
impl PartialEq for TemplateElement
fn eq(&self, other: &TemplateElement) -> bool
[src]
fn eq(&self, other: &TemplateElement) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &TemplateElement) -> bool
[src]
fn ne(&self, other: &TemplateElement) -> bool
This method tests for !=
.
Auto Trait Implementations
impl Send for TemplateElement
impl Send for TemplateElement
impl Sync for TemplateElement
impl Sync for TemplateElement