1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::loader::{DecisionLoader, LoaderError, LoaderResponse};
use anyhow::anyhow;
use async_trait::async_trait;

/// Default loader which always fails
#[derive(Default, Debug)]
pub struct NoopLoader;

#[async_trait]
impl DecisionLoader for NoopLoader {
    async fn load(&self, key: &str) -> LoaderResponse {
        Err(LoaderError::Internal {
            key: key.to_string(),
            source: anyhow!("Loader is no-op"),
        }
        .into())
    }
}