pub enum Element<'a> {
Group(GroupKind, Vec<SpannedElement<'a>>),
Atom(Atom<'a>),
Comment(&'a str),
}
Expand description
Element of S-Expr
Variants§
Implementations§
Source§impl<'a> Element<'a>
impl<'a> Element<'a>
Sourcepub fn atom(&self) -> Option<&Atom<'a>>
pub fn atom(&self) -> Option<&Atom<'a>>
Return the atom if the element is an atom, otherwise None
Sourcepub fn group(&self, grp: GroupKind) -> Option<&[SpannedElement<'a>]>
pub fn group(&self, grp: GroupKind) -> Option<&[SpannedElement<'a>]>
Return the group elements if the element is a group of the right type, otherwise None
Sourcepub fn paren(&self) -> Option<&[SpannedElement<'a>]>
pub fn paren(&self) -> Option<&[SpannedElement<'a>]>
Return the group elements if the element is a paren group, otherwise None
Sourcepub fn bracket(&self) -> Option<&[SpannedElement<'a>]>
pub fn bracket(&self) -> Option<&[SpannedElement<'a>]>
Return the group elements if the element is a bracket group, otherwise None
Sourcepub fn brace(&self) -> Option<&[SpannedElement<'a>]>
pub fn brace(&self) -> Option<&[SpannedElement<'a>]>
Return the group elements if the element is a brace group, otherwise None
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Element<'a>
impl<'a> RefUnwindSafe for Element<'a>
impl<'a> Send for Element<'a>
impl<'a> Sync for Element<'a>
impl<'a> Unpin for Element<'a>
impl<'a> UnwindSafe for Element<'a>
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