pub struct TextBudget { /* private fields */ }Expand description
One connection’s allowance for the things it types.
The same leaky bucket the reference server puts in front of TextMessage,
and it is worth having here rather than in the shard: a flood refused at the
socket never crosses a mailbox nor wakes a shard task.
The clock is passed in for the same reason VoiceBudget does it: a test
that has to sleep to observe a rate limit is a test that will be flaky.
REF: references/mumble/src/murmur/Messages.cpp : the RATELIMIT macro
returns from msgTextMessage without answering the client.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextBudget
impl RefUnwindSafe for TextBudget
impl Send for TextBudget
impl Sync for TextBudget
impl Unpin for TextBudget
impl UnwindSafe for TextBudget
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