use crate::raw::RawFormat;
#[derive(Debug, Clone, Default, PartialEq, Eq)]
#[non_exhaustive]
pub enum EdgeKindCoverage {
#[default]
All,
Mls(Vec<String>),
}
impl EdgeKindCoverage {
pub fn covers(&self, prefix: &str) -> bool {
match self {
EdgeKindCoverage::All => true,
EdgeKindCoverage::Mls(prefixes) => prefixes.iter().any(|p| p == prefix),
}
}
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
#[non_exhaustive]
pub enum StoreTimes {
Kept,
NotKept,
#[default]
Unknown,
}
impl StoreTimes {
pub fn as_str(self) -> &'static str {
match self {
StoreTimes::Kept => "kept",
StoreTimes::NotKept => "not_kept",
StoreTimes::Unknown => "unknown",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Eq)]
#[non_exhaustive]
pub struct Capabilities {
pub writes: bool,
pub transactions: bool,
pub several_dataspaces: bool,
pub contained_objects: bool,
pub prune_contained: bool,
pub subarrays: bool,
pub uninitialized_arrays: bool,
pub deletions_kept_for: Option<u64>,
pub raw_formats: Vec<RawFormat>,
pub store_times: StoreTimes,
pub edge_kinds: bool,
pub edge_kind_coverage: EdgeKindCoverage,
pub native_context: bool,
pub changes: bool,
}