pub struct Limits {
pub max_stack_depth: usize,
pub max_versions: usize,
pub max_nodes: usize,
pub max_steps: u64,
pub max_millis: u64,
}Expand description
解析的协作式资源上限:栈深、GLR 版本数、节点数、步数与可选墙钟时间预算。
Fields§
§max_stack_depth: usize§max_versions: usize正常最大活跃 GLR 版本数(归约过程允许少量内部溢出缓冲,随后裁剪回该上限;0 返回退化树)。
max_nodes: usize最大语法树节点数(0 返回退化树)。
max_steps: u64解析步数上限;0 表示按输入规模自动算(每字节 400 步加 20 万步)。超限返回退化树。
max_millis: u64协作式墙钟时间上限(毫秒);0 表示不限。超限返回退化树。
Trait Implementations§
Auto Trait Implementations§
impl Forget for Limits
impl Freeze for Limits
impl Move for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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