pub struct WireLimits { /* private fields */ }Expand description
Conservative limits applied before expensive parsing or verification.
Implementations§
Source§impl WireLimits
impl WireLimits
Sourcepub const MAXIMUM_MESSAGE_LEN: usize
pub const MAXIMUM_MESSAGE_LEN: usize
Hard upper bound for one canonical message.
Sourcepub const MAXIMUM_PARENT_EVENTS: usize = 1_024
pub const MAXIMUM_PARENT_EVENTS: usize = 1_024
Hard upper bound for compact parent references.
Sourcepub const MAXIMUM_WHY_DEPTH: usize = 32
pub const MAXIMUM_WHY_DEPTH: usize = 32
Hard upper bound for WHY traversal depth.
Sourcepub const MAXIMUM_EXPLANATION_EVENTS: usize = 10_000
pub const MAXIMUM_EXPLANATION_EVENTS: usize = 10_000
Hard upper bound for events returned in one explanation.
Sourcepub const UNSAFE_DEVELOPMENT_DO_NOT_USE_IN_PRODUCTION: Self
pub const UNSAFE_DEVELOPMENT_DO_NOT_USE_IN_PRODUCTION: Self
Unsafe development/test limits.
Production profiles must construct explicit limits with WireLimits::new
rather than reusing this convenience constant.
Sourcepub const fn new(
maximum_message_len: usize,
maximum_parent_events: usize,
maximum_why_depth: usize,
maximum_explanation_events: usize,
) -> Result<Self, ValidationError>
pub const fn new( maximum_message_len: usize, maximum_parent_events: usize, maximum_why_depth: usize, maximum_explanation_events: usize, ) -> Result<Self, ValidationError>
Creates validated wire limits.
Sourcepub const fn maximum_message_len(self) -> usize
pub const fn maximum_message_len(self) -> usize
Returns the maximum single message length in bytes.
Sourcepub const fn maximum_parent_events(self) -> usize
pub const fn maximum_parent_events(self) -> usize
Returns the maximum parent events in a compact cause capsule.
Sourcepub const fn maximum_why_depth(self) -> usize
pub const fn maximum_why_depth(self) -> usize
Returns the maximum WHY graph traversal depth.
Sourcepub const fn maximum_explanation_events(self) -> usize
pub const fn maximum_explanation_events(self) -> usize
Returns the maximum events returned by one explanation query.
Trait Implementations§
Source§impl Clone for WireLimits
impl Clone for WireLimits
Source§fn clone(&self) -> WireLimits
fn clone(&self) -> WireLimits
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 WireLimits
Source§impl Debug for WireLimits
impl Debug for WireLimits
impl Eq for WireLimits
Source§impl PartialEq for WireLimits
impl PartialEq for WireLimits
Source§fn eq(&self, other: &WireLimits) -> bool
fn eq(&self, other: &WireLimits) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WireLimits
Auto Trait Implementations§
impl Freeze for WireLimits
impl RefUnwindSafe for WireLimits
impl Send for WireLimits
impl Sync for WireLimits
impl Unpin for WireLimits
impl UnsafeUnpin for WireLimits
impl UnwindSafe for WireLimits
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