pub struct TemplateLiteral {
pub parts: Vec<TemplateLiteralPart>,
}Expand description
模板字面量类型,表示 ${string} 或更复杂的模板
Fields§
§parts: Vec<TemplateLiteralPart>模板片段列表
Implementations§
Source§impl TemplateLiteral
impl TemplateLiteral
Sourcepub fn from_parts(parts: Vec<TemplateLiteralPart>) -> Self
pub fn from_parts(parts: Vec<TemplateLiteralPart>) -> Self
从片段列表创建模板字面量类型
Sourcepub fn push_string(&mut self, s: String)
pub fn push_string(&mut self, s: String)
添加字符串字面量片段
Sourcepub fn push_number(&mut self)
pub fn push_number(&mut self)
添加数字占位符
Sourcepub fn push_string_type(&mut self)
pub fn push_string_type(&mut self)
添加字符串类型占位符
Sourcepub fn push_bigint(&mut self)
pub fn push_bigint(&mut self)
添加大整数占位符
Trait Implementations§
Source§impl Clone for TemplateLiteral
impl Clone for TemplateLiteral
Source§fn clone(&self) -> TemplateLiteral
fn clone(&self) -> TemplateLiteral
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TemplateLiteral
impl Debug for TemplateLiteral
Source§impl Default for TemplateLiteral
impl Default for TemplateLiteral
Source§impl Hash for TemplateLiteral
impl Hash for TemplateLiteral
Source§impl PartialEq for TemplateLiteral
impl PartialEq for TemplateLiteral
impl Eq for TemplateLiteral
impl StructuralPartialEq for TemplateLiteral
Auto Trait Implementations§
impl Freeze for TemplateLiteral
impl !RefUnwindSafe for TemplateLiteral
impl Send for TemplateLiteral
impl Sync for TemplateLiteral
impl Unpin for TemplateLiteral
impl UnsafeUnpin for TemplateLiteral
impl !UnwindSafe for TemplateLiteral
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