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