use crate::models::params::{RowExcludeFlags, RowIncludeFlags};
use crate::models::EnumStr;
use std::fmt;
#[derive(Debug)]
pub enum SheetIncludeFlags {
Base(RowIncludeFlags),
CrossSheetReferences,
FilterDefinitions,
GanttConfig,
OwnerInfo,
Proofs,
Source,
}
impl EnumStr for SheetIncludeFlags {
fn as_str<'a>(&self) -> &'a str {
match self {
Self::Base(flags) => flags.as_str(),
Self::CrossSheetReferences => "crossSheetReferences",
Self::FilterDefinitions => "filterDefinitions",
Self::GanttConfig => "ganttConfig",
Self::OwnerInfo => "ownerInfo",
Self::Proofs => "proofs",
Self::Source => "source",
}
}
}
impl fmt::Display for SheetIncludeFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(self.as_str())
}
}
#[derive(Debug)]
pub enum SheetExcludeFlags {
Base(RowExcludeFlags),
FilteredOutRows,
}
impl EnumStr for SheetExcludeFlags {
fn as_str<'a>(&self) -> &'a str {
match self {
Self::Base(flags) => flags.as_str(),
Self::FilteredOutRows => "filteredOutRows",
}
}
}
impl fmt::Display for SheetExcludeFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(self.as_str())
}
}