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 more