use std::fmt::Debug;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Hint {
Normal,
Low,
}
impl Default for Hint {
fn default() -> Self {
Self::Normal
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Location {
Default,
InMem,
OnDisk,
}
impl Default for Location {
fn default() -> Self {
Self::Default
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Age {
Young,
Old,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Populated {
pub age: Age,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Source {
Outer,
Populated(Populated),
}
impl Default for Source {
fn default() -> Self {
Self::Outer
}
}
pub trait Properties: Send + Sync + 'static + Clone + Default + Debug {
fn with_ephemeral(self, ephemeral: bool) -> Self;
fn ephemeral(&self) -> Option<bool>;
fn with_hint(self, hint: Hint) -> Self;
fn hint(&self) -> Option<Hint>;
fn with_location(self, location: Location) -> Self;
fn location(&self) -> Option<Location>;
fn with_source(self, source: Source) -> Self;
fn source(&self) -> Option<Source>;
}