Skip to main content

ontologos_parser/
limits.rs

1/// Resource limits for OWL file parsing.
2///
3/// Enforced before allocating large in-memory structures. See `docs/security.md`.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub struct ParseLimits {
6    /// Maximum ontology file size in bytes.
7    pub max_file_bytes: usize,
8    /// Maximum axioms stored in the core model.
9    pub max_axioms: usize,
10    /// Maximum entities registered during parse.
11    pub max_entities: usize,
12}
13
14impl Default for ParseLimits {
15    fn default() -> Self {
16        Self {
17            max_file_bytes: 64 * 1024 * 1024,
18            max_axioms: 10_000_000,
19            max_entities: 1_000_000,
20        }
21    }
22}