globetrotter_rust/
config.rs

1use std::path::PathBuf;
2
3/// Configuration for Rust translation code generation outputs.
4#[derive(Debug, Clone, PartialEq, Eq, Hash)]
5#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6pub struct OutputConfig {
7    /// File system paths where generated Rust translation bindings will be written.
8    #[cfg_attr(feature = "serde", serde(default))]
9    pub output_paths: Vec<PathBuf>,
10}
11
12impl OutputConfig {
13    /// Create a new output configuration from an iterator of paths.
14    pub fn new(paths: impl IntoIterator<Item = PathBuf>) -> Self {
15        Self {
16            output_paths: paths.into_iter().collect(),
17        }
18    }
19
20    /// Return `true` if there are no configured output paths.
21    #[must_use]
22    pub fn is_empty(&self) -> bool {
23        self.output_paths.is_empty()
24    }
25}