Trait uniplate::biplate::Biplate

source ·
pub trait Biplate<To>
where Self: Sized + Clone + Eq + Uniplate + 'static, To: Sized + Clone + Eq + Uniplate + 'static,
{ // Required method fn biplate(&self) -> (Tree<To>, Box<dyn Fn(Tree<To>) -> Self>); // Provided methods fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self { ... } fn universe_bi(&self) -> Vector<To> { ... } fn children_bi(&self) -> Vector<To> { ... } fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self { ... } }

Required Methods§

source

fn biplate(&self) -> (Tree<To>, Box<dyn Fn(Tree<To>) -> Self>)

Returns all the top most children of type to within from.

If from == to then this function should return the root as the single child.

Provided Methods§

source

fn descend_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Like descend but with more general types.

If from == to then this function does not descend. Therefore, when writing definitions it is highly unlikely that this function should be used in the recursive case. A common pattern is to first match the types using descendBi, then continue the recursion with descend.

source

fn universe_bi(&self) -> Vector<To>

source

fn children_bi(&self) -> Vector<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children).

source

fn transform_bi(&self, op: Arc<dyn Fn(To) -> To>) -> Self

Object Safety§

This trait is not object safe.

Implementors§