#[repr(u8)]pub enum OverflowPolicy {
Reject = 0,
DropNewest = 1,
DropOldest = 2,
}Expand description
What happens when a hop would exceed the mailbox’s logical capacity.
§Why there is no Block
Parking the OS worker on a full mailbox would stall every other flow
on that thread — the opposite of an M:N scheduler. Backpressure that
waits belongs to a future scheduler state (WAITING_SEND → runnable
when a slot frees), not to a queue method that holds a worker.
This revision therefore only offers non-blocking overflow:
| Policy | Effect |
|---|---|
Reject | Hop is not accepted; caller sees super::MailboxFull / crate::SendError::MailboxFull |
DropNewest | Incoming hop discarded; queue unchanged |
DropOldest | Oldest queued hop dropped, incoming enqueued (still FIFO among survivors) |
Default is Reject: fail-closed. Silent drop is an
explicit embedder choice.
Variants§
Trait Implementations§
Source§impl Clone for OverflowPolicy
impl Clone for OverflowPolicy
Source§fn clone(&self) -> OverflowPolicy
fn clone(&self) -> OverflowPolicy
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 OverflowPolicy
Source§impl Debug for OverflowPolicy
impl Debug for OverflowPolicy
Source§impl Default for OverflowPolicy
impl Default for OverflowPolicy
impl Eq for OverflowPolicy
Source§impl PartialEq for OverflowPolicy
impl PartialEq for OverflowPolicy
impl StructuralPartialEq for OverflowPolicy
Auto Trait Implementations§
impl Freeze for OverflowPolicy
impl RefUnwindSafe for OverflowPolicy
impl Send for OverflowPolicy
impl Sync for OverflowPolicy
impl Unpin for OverflowPolicy
impl UnsafeUnpin for OverflowPolicy
impl UnwindSafe for OverflowPolicy
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