pub struct DecoratorGate { /* private fields */ }Expand description
The file-level optimization-decorator contract (## No <opt> / ## Require <opt>) in ONE
place, so no compile/run/emit tier can silently drop it — the drift that let the decorators
be ignored on the C, VM, wasm and isa paths. Every tier does the same two steps:
install_decorators(...) at scope entry, then gate.verify()? after compilation.
Implementations§
Source§impl DecoratorGate
impl DecoratorGate
Sourcepub fn for_required(required: Vec<Opt>) -> DecoratorGate
pub fn for_required(required: Vec<Opt>) -> DecoratorGate
Open a fired-trace for required (when non-empty and no trace is already active) WITHOUT
touching the active config — for the run/VM/wasm/isa seam, where ## No was already
installed upstream (parse_seam) and only ## Require remains to enforce. Pair with
verify (checks) or close (discards on a prior error).
Sourcepub fn close(self)
pub fn close(self)
End the trace this gate owns without checking ## Require — used when compilation already
failed so its own error propagates instead of a spurious ## Require message.
Sourcepub fn verify(self) -> Result<(), String>
pub fn verify(self) -> Result<(), String>
Close the trace this gate owns and fail loudly on any ## Require <opt> whose
optimization did not fire for the program — the honest answer when a backend cannot
provide a demanded optimization (e.g. ## Require memo under the VM/wasm tier, where
memoization is an AOT-codegen construct). Returns the ready-to-surface error message.
Auto Trait Implementations§
impl Freeze for DecoratorGate
impl RefUnwindSafe for DecoratorGate
impl Send for DecoratorGate
impl Sync for DecoratorGate
impl Unpin for DecoratorGate
impl UnsafeUnpin for DecoratorGate
impl UnwindSafe for DecoratorGate
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.