use crate::fetch_policy::FetchPolicy;
use crate::load_budget::LoadBudget;
#[derive(Debug, Clone, Copy)]
pub struct OutputPipelineOptions {
pub reference_mode: ReferenceMode,
pub strip_descriptions: bool,
pub minimize: bool,
}
#[derive(Debug, Clone, Copy)]
pub struct PolicyInputOptions {
pub reference_mode: ReferenceMode,
pub fetch_policy: FetchPolicy,
pub load_budget: LoadBudget,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ReferenceMode {
SelfContained,
FullyInlinedExport,
PreserveRefs,
}
impl ReferenceMode {
#[must_use]
pub fn from_flags(keep_refs: bool, inline_refs: bool) -> Self {
if keep_refs {
Self::PreserveRefs
} else if inline_refs {
Self::FullyInlinedExport
} else {
Self::SelfContained
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum JsonOutputFormat {
Pretty,
Compact,
}
impl JsonOutputFormat {
#[must_use]
pub fn from_compact(compact: bool) -> Self {
if compact { Self::Compact } else { Self::Pretty }
}
}
#[cfg(test)]
#[path = "tests/options.rs"]
mod tests;