pub enum CreditPolicy {
Drop,
Detach,
Park,
}Expand description
Credit policy (router-enforced credits).
Credits are an overload-control mechanism, not a reliability mechanism.
§Contract
- Credit enforcement is implemented in the router loop; it does not change the underlying ABI layout.
- Credits are based on an estimated per-consumer queue depth and are best-effort.
- Credit policies are primarily intended for [
RouterMode::WorkQueue].
Variants§
Drop
Drop when a message cannot be delivered due to credit exhaustion.
Detach
Temporarily detach consumers that remain over the credit limit for long enough.
Detached consumers are not considered for delivery until they catch up.
Requires the std feature to measure elapsed time for the detach threshold. Without
std, this behaves like CreditPolicy::Park (no detaches will occur).
Park
When no consumers are eligible (work-queue only), wait instead of dropping.
Trait Implementations§
Source§impl Clone for CreditPolicy
impl Clone for CreditPolicy
Source§fn clone(&self) -> CreditPolicy
fn clone(&self) -> CreditPolicy
Returns a duplicate of the value. Read more
1.0.0 · 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 CreditPolicy
impl Debug for CreditPolicy
Source§impl PartialEq for CreditPolicy
impl PartialEq for CreditPolicy
impl Copy for CreditPolicy
impl Eq for CreditPolicy
impl StructuralPartialEq for CreditPolicy
Auto Trait Implementations§
impl Freeze for CreditPolicy
impl RefUnwindSafe for CreditPolicy
impl Send for CreditPolicy
impl Sync for CreditPolicy
impl Unpin for CreditPolicy
impl UnwindSafe for CreditPolicy
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