#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum BudgetKind {
Work,
Observations,
Depth,
Output,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct QueryBudgets {
pub max_work: usize,
pub max_observations: usize,
pub max_depth: usize,
pub max_output: usize,
}
impl QueryBudgets {
#[must_use]
pub const fn unlimited() -> Self {
Self {
max_work: usize::MAX,
max_observations: usize::MAX,
max_depth: usize::MAX,
max_output: usize::MAX,
}
}
#[must_use]
pub const fn new(
max_work: usize,
max_observations: usize,
max_depth: usize,
max_output: usize,
) -> Self {
Self {
max_work,
max_observations,
max_depth,
max_output,
}
}
}
impl Default for QueryBudgets {
fn default() -> Self {
Self::unlimited()
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct SnapshotBudgets {
pub max_nodes: usize,
pub max_edges: usize,
}
impl SnapshotBudgets {
#[must_use]
pub const fn unlimited() -> Self {
Self {
max_nodes: usize::MAX,
max_edges: usize::MAX,
}
}
#[must_use]
pub const fn new(max_nodes: usize, max_edges: usize) -> Self {
Self {
max_nodes,
max_edges,
}
}
}
impl Default for SnapshotBudgets {
fn default() -> Self {
Self::unlimited()
}
}