pub enum CompiledCostExpr {
Unknown,
Expr(CostNode),
Declared {
flops: Option<CostNode>,
bytes_moved: Option<CostNode>,
overhead_ns: Option<CostNode>,
},
}Expand description
A compiled cost-expression AST (FKC §4.4 / §2.3 strategy A).
Cloneable + comparable so it can ride on a resolved record and be asserted in tests. Held as data, never as a fn-pointer (this slice).
Variants§
Unknown
Sentinel: no cost claim (absent block / class-only /
judge_measured with no expressions). Maps to unknown_cost in the
register slice.
Expr(CostNode)
A parsed expression tree: the flops expression alone (a contract
that declares no bytes_moved, so bytes_moved evaluates to 0).
Declared
A contract that declares a bytes_moved expression (GAP-376) and/or an
overhead_ns (GAP-382). Any side may be absent: flops: None is a
bytes-only block, whose bytes formula must never be read as flops. Built
only by compile_cost.
Trait Implementations§
Source§impl Clone for CompiledCostExpr
impl Clone for CompiledCostExpr
Source§impl Debug for CompiledCostExpr
impl Debug for CompiledCostExpr
Source§impl PartialEq for CompiledCostExpr
impl PartialEq for CompiledCostExpr
impl StructuralPartialEq for CompiledCostExpr
Auto Trait Implementations§
impl Forget for CompiledCostExpr
impl Freeze for CompiledCostExpr
impl Move for CompiledCostExpr
impl RefUnwindSafe for CompiledCostExpr
impl Send for CompiledCostExpr
impl Sync for CompiledCostExpr
impl Unpin for CompiledCostExpr
impl UnsafeUnpin for CompiledCostExpr
impl UnwindSafe for CompiledCostExpr
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more