pub struct SurbRefund(Option<Arc<AtomicU64>>);Expand description
The SURB a sender has already counted as consumed for an outgoing return packet, given back if the packet is dropped before it takes one.
A return packet takes its SURB only when its routing is resolved, but a sender whose reserve and
admission decisions need the count at once counts it as it hands the packet on. Resolution may
still find no SURB in time and drop the packet; it then calls give_back, so
that the count is undone. The refund points at the sender’s own counter rather than naming the
sender: by the time the packet is dropped, the Session that counted it may be gone, or its
identifier taken by another one.
It counts the SURB onto a counter of the sender’s own rather than taking one off the consumed count: the readers of these counters take deltas between samples, so every counter has to keep growing, and which of them add the refunds back is the sender’s choice. Empty by default: a packet nobody counted gives nothing back.
Tuple Fields§
§0: Option<Arc<AtomicU64>>Implementations§
Source§impl SurbRefund
impl SurbRefund
Trait Implementations§
Source§impl Clone for SurbRefund
impl Clone for SurbRefund
Source§fn clone(&self) -> SurbRefund
fn clone(&self) -> SurbRefund
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SurbRefund
impl Debug for SurbRefund
Source§impl Default for SurbRefund
impl Default for SurbRefund
Source§fn default() -> SurbRefund
fn default() -> SurbRefund
impl Eq for SurbRefund
Source§impl PartialEq for SurbRefund
Two refunds are equal when they give back to the same counter, or when neither gives anything back.
impl PartialEq for SurbRefund
Two refunds are equal when they give back to the same counter, or when neither gives anything back.
Auto Trait Implementations§
impl Freeze for SurbRefund
impl RefUnwindSafe for SurbRefund
impl Send for SurbRefund
impl Sync for SurbRefund
impl Unpin for SurbRefund
impl UnsafeUnpin for SurbRefund
impl UnwindSafe for SurbRefund
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more