pub struct AstDepth;Expand description
A simple CostFunction that counts maximum AST depth.
let e: RecExpr<SymbolLang> = "(do_it foo bar baz)".parse().unwrap();
assert_eq!(AstDepth.cost_rec(&e), 2);Trait Implementations§
Source§impl<L: Language> CostFunction<L> for AstDepth
impl<L: Language> CostFunction<L> for AstDepth
Auto Trait Implementations§
impl Freeze for AstDepth
impl RefUnwindSafe for AstDepth
impl Send for AstDepth
impl Sync for AstDepth
impl Unpin for AstDepth
impl UnwindSafe for AstDepth
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