Skip to main content

no_mistakes_postgres_engine/options/
executor_selection.rs

1use super::{EmbeddedSqlOptions, DEFAULT_EXECUTOR_NAMES};
2
3impl EmbeddedSqlOptions {
4    pub fn is_callable_export(&self, name: &str) -> bool {
5        DEFAULT_EXECUTOR_NAMES.contains(&name)
6            || self
7                .executor_names
8                .iter()
9                .any(|candidate| candidate == name)
10            || self
11                .executor_factory_names
12                .iter()
13                .any(|candidate| candidate == name)
14    }
15
16    pub fn uses_legacy_executor_defaults(&self) -> bool {
17        self.executor_names.is_empty() && self.exclude_executor_names.is_empty()
18    }
19
20    pub fn selects_executors(&self) -> bool {
21        !self.executor_names.is_empty()
22            || !self.executor_factory_names.is_empty()
23            || !self.executor_type_names.is_empty()
24    }
25}