Skip to content

rewrite

Structs

  • RewriteEventProbe - Probe used by headless tests to observe rewrite event dispatch.

Enums

Type Aliases


firma_tui::control::rewrite::PolicyRewriteEvent

Section titled “firma_tui::control::rewrite::PolicyRewriteEvent”

Enum

Notification emitted by the rewrite worker.

A request first reports that it has started, then reports completion with either a structured error or a successful write result. The TUI still refreshes policy state from disk after success instead of trusting the requested state.

Variants:

  • Started(crate::control::state::PolicyRewriteStart) - The worker has started writing the batch.
  • Completed(crate::control::state::PolicyRewriteCompletion) - The worker has finished the batch.

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result

firma_tui::control::rewrite::PolicyRewriteHandler

Section titled “firma_tui::control::rewrite::PolicyRewriteHandler”

Type Alias: Box<dyn Fn>

Fn used by the worker to persist one rewrite request.

The default handler calls the Cedar rewrite layer. Tests replace it with a controlled handler so they can pause active writes and check queue behavior without depending on timing.

firma_tui::control::rewrite::RewriteEventProbe

Section titled “firma_tui::control::rewrite::RewriteEventProbe”

Struct

Probe used by headless tests to observe rewrite event dispatch.

Rewrite handlers can signal that their own work has returned before the queue worker has sent the corresponding runner event. This probe is tied to the worker’s event dispatch point, so tests can wait for the event that try_crank will actually observe.

Methods:

  • fn wait_for_started(self: &Self, timeout: Duration) -> Result<(), RewriteEventProbeError> - Waits until the worker has dispatched a started event.
  • fn wait_for_completed(self: &Self, timeout: Duration) -> Result<(), RewriteEventProbeError> - Waits until the worker has dispatched a completion event.