pub struct Tree<'a>(_);Expand description
Implementations
sourceimpl<'a> Tree<'a>
impl<'a> Tree<'a>
sourcepub fn flatten_tree(&self) -> Css<'a>
pub fn flatten_tree(&self) -> Css<'a>
sourcepub fn transform<T>(&mut self, f: impl FnMut(&mut T))where
Self: TransformCss<T>,
pub fn transform<T>(&mut self, f: impl FnMut(&mut T))where
Self: TransformCss<T>,
A mutable transform which walks this AST recursively, invoking f for
all nodes of type T.
Example
use procss::{ast, parse, RenderCss};
let mut tree = parse("div{color: red;}").unwrap();
tree.transform(|rule: &mut ast::Rule| {
rule.value = "green".into();
});
let css = tree.flatten_tree().as_css_string();
assert_eq!(css, "div{color:green;}");sourcepub fn iter(&self) -> impl Iterator<Item = &TreeRuleset<'a>>
pub fn iter(&self) -> impl Iterator<Item = &TreeRuleset<'a>>
Iterate over the immediate children of this Tree (non-recursive).
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Tree<'a>
impl<'a> Send for Tree<'a>
impl<'a> Sync for Tree<'a>
impl<'a> Unpin for Tree<'a>
impl<'a> UnwindSafe for Tree<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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