#[non_exhaustive]pub struct CompileLimits {
pub max_source: usize,
pub max_rules: usize,
pub max_nodes: usize,
pub max_work: u64,
pub max_diagnostics: usize,
}Expand description
Limits for compiling untrusted rule text.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_source: usizeMaximum source length in bytes.
max_rules: usizeMaximum number of rules.
max_nodes: usizeMaximum nodes per rule.
max_work: u64Maximum total work (node visits) spent validating rules at their width assignments.
max_diagnostics: usizeMaximum number of diagnostics before compilation stops.
Implementations§
Source§impl CompileLimits
impl CompileLimits
Sourcepub fn with_max_source(self, value: usize) -> Self
pub fn with_max_source(self, value: usize) -> Self
Sets max_source.
Sourcepub fn with_max_rules(self, value: usize) -> Self
pub fn with_max_rules(self, value: usize) -> Self
Sets max_rules.
Sourcepub fn with_max_nodes(self, value: usize) -> Self
pub fn with_max_nodes(self, value: usize) -> Self
Sets max_nodes.
Sourcepub fn with_max_work(self, value: u64) -> Self
pub fn with_max_work(self, value: u64) -> Self
Sets max_work.
Sourcepub fn with_max_diagnostics(self, value: usize) -> Self
pub fn with_max_diagnostics(self, value: usize) -> Self
Sets max_diagnostics.
Trait Implementations§
Source§impl Clone for CompileLimits
impl Clone for CompileLimits
Source§impl Debug for CompileLimits
impl Debug for CompileLimits
Auto Trait Implementations§
impl Forget for CompileLimits
impl Freeze for CompileLimits
impl Move for CompileLimits
impl RefUnwindSafe for CompileLimits
impl Send for CompileLimits
impl Sync for CompileLimits
impl Unpin for CompileLimits
impl UnsafeUnpin for CompileLimits
impl UnwindSafe for CompileLimits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more