oris_kernel/kernel/
stubs.rs1use crate::kernel::action::{Action, ActionExecutor, ActionResult};
5use crate::kernel::identity::RunId;
6use crate::kernel::policy::{Policy, PolicyCtx};
7use crate::kernel::state::KernelState;
8use crate::kernel::step::{Next, StepFn};
9use crate::kernel::KernelError;
10
11pub struct NoopActionExecutor;
13
14impl ActionExecutor for NoopActionExecutor {
15 fn execute(&self, _run_id: &RunId, _action: &Action) -> Result<ActionResult, KernelError> {
16 Err(KernelError::Driver(
17 "action execution not used in replay".into(),
18 ))
19 }
20}
21
22pub struct NoopStepFn;
24
25impl<S: KernelState> StepFn<S> for NoopStepFn {
26 fn next(&self, _state: &S) -> Result<Next, KernelError> {
27 Ok(Next::Complete)
28 }
29}
30
31pub struct AllowAllPolicy;
33
34impl Policy for AllowAllPolicy {
35 fn authorize(
36 &self,
37 _run_id: &RunId,
38 _action: &Action,
39 _ctx: &PolicyCtx,
40 ) -> Result<(), KernelError> {
41 Ok(())
42 }
43}