pub struct Tag { /* private fields */ }Expand description
Implementations§
Source§impl Tag
impl Tag
pub fn new( name: &str, props: Props, ty: CloseType, children: Option<Vec<ASTNodes>>, parent: Option<ASTNodes>, ) -> Self
Sourcepub fn new_tag_start(name: &str) -> Self
pub fn new_tag_start(name: &str) -> Self
§new tag start
new a tag start without props, children and parent
Sourcepub fn new_tag_props(name: &str, props: Props) -> Self
pub fn new_tag_props(name: &str, props: Props) -> Self
§new tag props
new a tag with props, without children and parent
pub fn set_name(&mut self, name: &str)
pub fn set_ty(&mut self, ty: CloseType)
pub fn set_props(&mut self, props: Props)
pub fn set_children(&mut self, children: Vec<ASTNodes>)
Sourcepub fn push_children(&mut self, child: ASTNodes)
pub fn push_children(&mut self, child: ASTNodes)
push a child to children
Sourcepub fn extend_children(&mut self, children: Vec<ASTNodes>)
pub fn extend_children(&mut self, children: Vec<ASTNodes>)
extend children to children
pub fn set_parent(&mut self, parent: ASTNodes)
pub fn get_name(&self) -> &str
pub fn get_type(&self) -> CloseType
pub fn has_children(&self) -> bool
pub fn get_children(&self) -> Option<&Vec<ASTNodes>>
pub fn has_props(&self) -> bool
pub fn get_props(&self) -> Option<&HashMap<PropsKey, Value>>
Sourcepub fn is_self_closed(&self) -> bool
pub fn is_self_closed(&self) -> bool
is current tag is self closed or not
pub fn extend_props(&mut self, props: HashMap<PropsKey, Value>)
Trait Implementations§
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
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