pub enum DiffSizeError {
TooManyOps {
got: usize,
cap: usize,
},
Encoded {
got: usize,
cap: usize,
},
}Expand description
Error returned by CapabilityDiff::try_to_bytes when the diff
would exceed the wire-format caps the receiver enforces.
Senders that build diffs from peer-supplied or
large-cardinality input MUST surface this error rather than
swallow it. Without a sender-side cap, to_bytes would
silently emit bytes that every peer’s from_bytes discarded
— silent state divergence indistinguishable from a network
drop.
Variants§
TooManyOps
ops.len() exceeds MAX_DIFF_OPS. Detected before
serialization so the sender pays no heap cost on rejection.
Encoded
Encoded byte length exceeds MAX_DIFF_BYTES. Surfaces
either the actual encoded length (post-serialize) or a
best-estimate from estimated_size() if the encoder
itself failed.
Trait Implementations§
Source§impl Clone for DiffSizeError
impl Clone for DiffSizeError
Source§fn clone(&self) -> DiffSizeError
fn clone(&self) -> DiffSizeError
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 moreSource§impl Debug for DiffSizeError
impl Debug for DiffSizeError
Source§impl Display for DiffSizeError
impl Display for DiffSizeError
Source§impl Error for DiffSizeError
impl Error for DiffSizeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for DiffSizeError
impl PartialEq for DiffSizeError
Source§fn eq(&self, other: &DiffSizeError) -> bool
fn eq(&self, other: &DiffSizeError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DiffSizeError
Auto Trait Implementations§
impl Freeze for DiffSizeError
impl RefUnwindSafe for DiffSizeError
impl Send for DiffSizeError
impl Sync for DiffSizeError
impl Unpin for DiffSizeError
impl UnsafeUnpin for DiffSizeError
impl UnwindSafe for DiffSizeError
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