zen_engine/loader/noop.rs
1use std::future::Future;
2
3use anyhow::anyhow;
4
5use crate::loader::{DecisionLoader, LoaderError, LoaderResponse};
6
7/// Default loader which always fails
8#[derive(Default, Debug)]
9pub struct NoopLoader;
10
11impl DecisionLoader for NoopLoader {
12 fn load<'a>(&'a self, key: &'a str) -> impl Future<Output = LoaderResponse> + 'a {
13 async move {
14 Err(LoaderError::Internal {
15 key: key.to_string(),
16 source: anyhow!("Loader is no-op"),
17 }
18 .into())
19 }
20 }
21}