pub struct MailboxBytes(/* private fields */);Expand description
Byte budget for one flow’s inbox, enforced alongside
MailboxCapacity.
§Why a hop count is not a memory bound
MailboxCapacity bounds how many hops an inbox holds. Since ABI v4
a hop may carry crate::Value::Str / crate::Value::Bytes, and the
.bf decoder accepts blobs up to 1 MiB, so “256 hops” is anywhere from
~12 KiB of scalars to ~256 MiB of blobs. A count alone therefore does
not bound RSS — which is the whole point of bounding the mailbox.
Cost per hop comes from crate::Value::memory_size; read its doc for
why Arc-shared payloads are deliberately over-charged.
§Choosing the default
DEFAULT is 4 MiB, which must stay strictly greater than the
largest single hop the .bf decoder will produce (MAX_BLOB in
crate::decode’s module, 1 MiB) plus its envelope. A budget equal to
the maximum payload size would make a legal, decodable constant
permanently undeliverable under the default config — a bound should
refuse abuse, not valid inputs. byte_budget_default_fits_one_max_hop
guards that relationship.
MIN = 1 KiB (an inbox that cannot hold a handful of scalar hops is
not an inbox). MAX = 1 GiB is a hard ceiling, not a recommendation.
Implementations§
Trait Implementations§
Source§impl Clone for MailboxBytes
impl Clone for MailboxBytes
Source§fn clone(&self) -> MailboxBytes
fn clone(&self) -> MailboxBytes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MailboxBytes
Source§impl Debug for MailboxBytes
impl Debug for MailboxBytes
Source§impl Default for MailboxBytes
impl Default for MailboxBytes
impl Eq for MailboxBytes
Source§impl Hash for MailboxBytes
impl Hash for MailboxBytes
Source§impl Ord for MailboxBytes
impl Ord for MailboxBytes
Source§fn cmp(&self, other: &MailboxBytes) -> Ordering
fn cmp(&self, other: &MailboxBytes) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for MailboxBytes
impl PartialEq for MailboxBytes
Source§impl PartialOrd for MailboxBytes
impl PartialOrd for MailboxBytes
impl StructuralPartialEq for MailboxBytes
Auto Trait Implementations§
impl Freeze for MailboxBytes
impl RefUnwindSafe for MailboxBytes
impl Send for MailboxBytes
impl Sync for MailboxBytes
impl Unpin for MailboxBytes
impl UnsafeUnpin for MailboxBytes
impl UnwindSafe for MailboxBytes
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.