pub struct AuditQueue { /* private fields */ }Expand description
BIDIR-8: a bounded queue in front of an AuditSink, so a refusal on a
duplex call’s frame path is audited without waiting on the sink. An
offer never blocks: a full queue drops the record
and counts it (dropped). The drain is the
future AuditQueue::new answers — the service spawns it; it writes
each record to the sink in order and ends when every queue handle is gone.
Implementations§
Source§impl AuditQueue
impl AuditQueue
Sourcepub fn new(
capacity: usize,
sink: Arc<dyn AuditSink>,
) -> (Self, impl Future<Output = ()> + Send + 'static)
pub fn new( capacity: usize, sink: Arc<dyn AuditSink>, ) -> (Self, impl Future<Output = ()> + Send + 'static)
A queue of capacity records in front of sink, and its drain.
Sourcepub fn offer(&self, record: AuditRecord) -> bool
pub fn offer(&self, record: AuditRecord) -> bool
Hand record to the sink, or — the queue full or its drain gone —
drop it and count it. Never waits. true: taken.
Trait Implementations§
Source§impl Clone for AuditQueue
impl Clone for AuditQueue
Auto Trait Implementations§
impl Forget for AuditQueue
impl Freeze for AuditQueue
impl Move for AuditQueue
impl RefUnwindSafe for AuditQueue
impl Send for AuditQueue
impl Sync for AuditQueue
impl Unpin for AuditQueue
impl UnsafeUnpin for AuditQueue
impl UnwindSafe for AuditQueue
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