use crate::kernel::action::{Action, ActionExecutor, ActionResult};
use crate::kernel::identity::RunId;
use crate::kernel::policy::{Policy, PolicyCtx};
use crate::kernel::state::KernelState;
use crate::kernel::step::{Next, StepFn};
use crate::kernel::KernelError;
pub struct NoopActionExecutor;
impl ActionExecutor for NoopActionExecutor {
fn execute(&self, _run_id: &RunId, _action: &Action) -> Result<ActionResult, KernelError> {
Err(KernelError::Driver(
"action execution not used in replay".into(),
))
}
}
pub struct NoopStepFn;
impl<S: KernelState> StepFn<S> for NoopStepFn {
fn next(&self, _state: &S) -> Result<Next, KernelError> {
Ok(Next::Complete)
}
}
pub struct AllowAllPolicy;
impl Policy for AllowAllPolicy {
fn authorize(
&self,
_run_id: &RunId,
_action: &Action,
_ctx: &PolicyCtx,
) -> Result<(), KernelError> {
Ok(())
}
}