pub struct OutboundQueue { /* private fields */ }Expand description
FIFO of wire envelopes ready to ship.
Implementations§
Source§impl OutboundQueue
impl OutboundQueue
Sourcepub fn with_cap(cap: Option<usize>) -> Self
pub fn with_cap(cap: Option<usize>) -> Self
Construct a fresh outbound queue with the given FIFO-drop
cap. None disables the cap.
Sourcepub fn push(&mut self, env: WireEnvelope)
pub fn push(&mut self, env: WireEnvelope)
Push an envelope for shipment. If a cap is set and the queue is at the cap, FIFO-evict the oldest entry and bump the drop counter.
Stamps schema_version here so the encode boundary can read
&WireEnvelope and call encode_to_vec without cloning the
payload to set the field defensively.
Sourcepub fn drain_all(&mut self) -> Vec<WireEnvelope>
pub fn drain_all(&mut self) -> Vec<WireEnvelope>
Drain all queued envelopes. Called by Phase 8 of the poll cycle.
Sourcepub fn take_dropped_count(&mut self) -> usize
pub fn take_dropped_count(&mut self) -> usize
Read + reset the count of FIFO-dropped envelopes since the last call. Returns 0 when no drops occurred.
Sourcepub fn iter_for_snapshot(&self) -> impl Iterator<Item = &WireEnvelope>
pub fn iter_for_snapshot(&self) -> impl Iterator<Item = &WireEnvelope>
Iterate queued envelopes for snapshot capture. The queue is not consumed - Phase 8 still drains on the next poll. .
Trait Implementations§
Source§impl Default for OutboundQueue
impl Default for OutboundQueue
Source§fn default() -> OutboundQueue
fn default() -> OutboundQueue
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OutboundQueue
impl RefUnwindSafe for OutboundQueue
impl Send for OutboundQueue
impl Sync for OutboundQueue
impl Unpin for OutboundQueue
impl UnsafeUnpin for OutboundQueue
impl UnwindSafe for OutboundQueue
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedComponent for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request