#[non_exhaustive]pub struct AliasLimits {
pub max_total_replayed_events: usize,
pub max_replay_stack_depth: usize,
pub max_alias_expansions_per_anchor: usize,
}Expand description
Limits applied to alias replay to harden against alias bombs.
These limits also apply while aliases are expanded from anchored !include fragments.
Prefer constructing this via the alias_limits! macro instead of a
struct literal. This keeps call sites stable if new fields are added in the future.
let limits = serde_saphyr::alias_limits! {
max_replay_stack_depth: 32,
};
assert_eq!(limits.max_replay_stack_depth, 32);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_total_replayed_events: usizeMaximum total number of replayed events injected from aliases across the entire parse. When exceeded, deserialization errors (alias replay limit exceeded).
max_replay_stack_depth: usizeMaximum depth of the alias replay stack (nested alias → injected buffer → alias, etc.).
max_alias_expansions_per_anchor: usizeMaximum number of times a single anchor id may be expanded via alias.
Use usize::MAX for “unlimited”.
Trait Implementations§
Source§impl Clone for AliasLimits
impl Clone for AliasLimits
Source§fn clone(&self) -> AliasLimits
fn clone(&self) -> AliasLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AliasLimits
Source§impl Debug for AliasLimits
impl Debug for AliasLimits
Auto Trait Implementations§
impl Freeze for AliasLimits
impl RefUnwindSafe for AliasLimits
impl Send for AliasLimits
impl Sync for AliasLimits
impl Unpin for AliasLimits
impl UnsafeUnpin for AliasLimits
impl UnwindSafe for AliasLimits
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