pub enum Element<'a> {
Group(GroupKind, Vec<SpannedElement<'a>>),
Atom(Atom<'a>),
Comment(&'a str),
}Expand description
Element of S-Expr
Variants
Group(GroupKind, Vec<SpannedElement<'a>>)
Atom(Atom<'a>)
Comment(&'a str)
Implementations
sourceimpl<'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
Trait Implementations
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more