pub struct SurbRoundTripRegistry {
destinations: Arc<DashMap<ForwardAndReturnPath, OffchainPublicKey>>,
observer: Option<TransportObserver>,
inner: Arc<DashMap<ForwardAndReturnPath, Arc<SurbRoundTripCounters>>>,
relayer_health: Arc<RelayerHealth>,
pending: Arc<RandomEvictionMap<PendingSurb>>,
written_off: Arc<DashMap<HoprPseudonym, HashMap<OffchainPublicKey, VecDeque<Instant>>>>,
bumped: Arc<DashMap<(HoprPseudonym, OffchainPublicKey), Instant>>,
written_off_legs: Arc<RandomEvictionMap<([Option<OffchainPublicKey>; 5], Instant)>>,
pending_lost: Arc<AtomicU64>,
}Expand description
Round-trip counts keyed by the legs they were observed over.
Batching is not an optimisation here but a requirement: recording an edge takes a write lock on the whole graph, a packet carries several SURBs, and a session at 0.5 MB/s moves hundreds of packets a second – reporting per event would contend the graph thousands of times a second.
Fields§
§destinations: Arc<DashMap<ForwardAndReturnPath, OffchainPublicKey>>§observer: Option<TransportObserver>§inner: Arc<DashMap<ForwardAndReturnPath, Arc<SurbRoundTripCounters>>>§relayer_health: Arc<RelayerHealth>Per-relayer health from reply races, published into the graph.
pending: Arc<RandomEvictionMap<PendingSurb>>Every outstanding SURB, shared by both codec halves.
Minting happens on the encoder and the reply arrives at the decoder, so this must be one map shared by both. Giving each half its own leaves every lookup missing and silently discards the entire observation side of the metric.
written_off: Arc<DashMap<HoprPseudonym, HashMap<OffchainPublicKey, VecDeque<Instant>>>>Per session, SURBs written off because their return path runs through a relayer known dead, by
that relayer, even though the counterparty may still hold them. Kept while the relayer stays
known dead (a lapsed verdict only times out, the write-off outlives it), but dropped when the
session’s generation is advanced: the counterparty drops the stock the count stood for, and
what is counted afterwards is only the SURBs through the relayer minted since, the probes.
Each entry is the instants its SURBs were written off, oldest first, aged out after
WRITE_OFF_HORIZON; the count is their number.
bumped: Arc<DashMap<(HoprPseudonym, OffchainPublicKey), Instant>>When a dead verdict last made write_off_dead report a session for a
relayer, so that the same pair is not reported again. Kept for as long as the relayer is known
dead, and for REBUMP_COOLDOWN after it is not, so a pair advanced in this death stays
advanced, and a quick re-death after a revival is not advanced again either.
written_off_legs: Arc<RandomEvictionMap<([Option<OffchainPublicKey>; 5], Instant)>>The return legs of SURBs written off or wiped, for as long as a SURB is remembered.
Writing a SURB off takes it out of pending, but the counterparty still holds it and may spend
it: the reply of a probe through a relayer on probation arrives after the write-off, and a
wiped stock is spent until the new generation reaches the counterparty. Recognising it here is
what lets a reply home lift the verdict or the probation of the relayers on its leg. With each leg
goes the SURB’s mint time: a reply on a SURB older than a verdict already acted on is not news
about that relayer (see RelayerHealth::is_fresh_for).
Bounded like pending, by the same byte budget, so the pair uses up to twice the budget when
both fill; it evicts at random for the same reason: a leg is looked up once, when the reply of a
SURB the counterparty still held comes home, and by age or recency that would be the leg looked
up next. A leg it could not hold leaves a reply home finding nothing, which then cannot lift the
verdict of its relayers, but it is no loss of the pending map: the wipe or write-off that put it
here has already settled what the counterparty held, so such an eviction is not counted in
take_pending_lost.
pending_lost: Arc<AtomicU64>Records pending could not hold and evicted before their reply came home, since the last
take_pending_lost. An evicted record settles no race and is never
written off, so its Session’s SURBs through a dead relayer may go unnoticed. Zero in a
configuration where pending does not fill; non-zero means the byte budget is too small for the
node’s outstanding SURBs, and the metric built on it says so.
Implementations§
Source§impl SurbRoundTripRegistry
impl SurbRoundTripRegistry
Sourcepub fn with_observer(self, observer: TransportObserver) -> Self
pub fn with_observer(self, observer: TransportObserver) -> Self
Report minted and returned SURBs to observer. Attach it before cloning this registry.
Sourcefn record_minted(
&self,
paths: ForwardAndReturnPath,
count: u64,
destination: OffchainPublicKey,
)
fn record_minted( &self, paths: ForwardAndReturnPath, count: u64, destination: OffchainPublicKey, )
Notify the optional observer about minted SURBs independently of graph telemetry drains.
Sourcepub fn with_budget(max_bytes: u64) -> Self
pub fn with_budget(max_bytes: u64) -> Self
A registry whose pending maps each hold what fits in max_bytes of memory, clamped to the range
the config validator accepts, MINIMUM_PENDING_SURB_MAX_BYTES to MAXIMUM_PENDING_SURB_MAX_BYTES.
Each map turns the budget into records by the memory one of its records costs (see
record_bytes), so each honours the budget itself and
the pair, once both fill, uses up to twice it. Clamped rather than trusted so that 0, or a
record count passed by mistake, can never leave the maps holding next to nothing.
fn from_maps( pending: RandomEvictionMap<PendingSurb>, written_off_legs: RandomEvictionMap<([Option<OffchainPublicKey>; 5], Instant)>, ) -> Self
Sourcepub fn take_pending_lost(&self) -> u64
pub fn take_pending_lost(&self) -> u64
Takes the number of minted SURBs the pending map evicted before their replies could come home since the last call, because it was full.
Such a record settles no race and is never written off, and the loss is invisible in every other
counter. Only the pending map is counted: a leg evicted from the written-off map belongs to SURBs
whose accounting a wipe or a write-off already settled, which is no reason to raise the budget.
See with_budget.
Sourcefn remember(&self, surb_id: HoprSurbId, pending: PendingSurb)
fn remember(&self, surb_id: HoprSurbId, pending: PendingSurb)
Remembers a minted SURB until its reply comes home, and handles the record it evicted when the map was full: its reply will now find nothing, so it is counted as lost, and the race it was out on, if its partner’s reply was home, can no longer be closed and is discarded.
An eviction is no evidence about a relayer either way. Left open, the race would expire as a
loss of the relayers on the record’s leg, healthy or not, and under sustained eviction that is
enough unanswered races to judge a healthy relayer dead and wipe its Sessions’ stock (see
open_race for the eviction that lands before the race opens).
Sourcefn remember_written_off(
&self,
surb_id: HoprSurbId,
leg: [Option<OffchainPublicKey>; 5],
minted_at: Instant,
)
fn remember_written_off( &self, surb_id: HoprSurbId, leg: [Option<OffchainPublicKey>; 5], minted_at: Instant, )
Remembers the leg of a SURB written off or wiped, and discards the race of the leg it evicted: the reply of that SURB can no longer close it.
Not counted as lost, see take_pending_lost.
Sourcepub fn expire_step(&self)
pub fn expire_step(&self)
Drops the records of either map older than PENDING_SURB_HORIZON, a part of each map per call.
Cheap enough to run inline on every flush tick: it sweeps a sixteenth of the shards, holding one shard’s lock at a time.
Sourcepub fn has_write_offs(&self) -> bool
pub fn has_write_offs(&self) -> bool
Whether some session has SURBs written off, which is when invalid has anything
to report.
Sourcefn judges(&self, pair_index: usize) -> bool
fn judges(&self, pair_index: usize) -> bool
Whether the reply of the SURB at pair_index in its packet says anything about its return path
when it races its partner’s: only the SURB the replier spends first does, see
FIRST_SPENT_INDEX.
The other one is spent after it, so its reply trails the first’s by however long the replier took to get to it, a pause in its reply stream included, and that says nothing about a relayer. A race therefore opens only in the abnormal order, the later-spent SURB home while the first-spent one is still out, and what it measures is lateness down to the return path. Judging both would settle every pair in the normal order, and the largest inter-reply gap the replier ever had would become the bar a reply must stay out longer than to count as overdue.
Sourcefn open_race(
&self,
waiting: &[Option<OffchainPublicKey>; 5],
partner: HoprSurbId,
home: &[Option<OffchainPublicKey>; 5],
round_trip: Duration,
)
fn open_race( &self, waiting: &[Option<OffchainPublicKey>; 5], partner: HoprSurbId, home: &[Option<OffchainPublicKey>; 5], round_trip: Duration, )
Opens the race of partner, still out over waiting, against the reply that just came home over
home, and keeps it open only while partner can still close it.
The race is opened after partner’s record was updated, so the record can leave the pending map
in between: home, its reply settling a race not yet open, or evicted, its eviction finding no race
to discard. Either way nothing would ever close the race, and it would expire as a loss of the
relayers on waiting. Checked after the race is opened, so an eviction after the check finds the
race and discards it itself. A record written off in between is still in written_off_legs, and
its race is kept until that SURB’s reply comes home and closes it (see
SurbTelemetryCodec::on_replied), as one written off after the race opened is.
fn counters(&self, paths: ForwardAndReturnPath) -> Arc<SurbRoundTripCounters> ⓘ
Sourcepub fn record_expected(&self, paths: ForwardAndReturnPath, count: u64)
pub fn record_expected(&self, paths: ForwardAndReturnPath, count: u64)
Records that count SURBs were minted over these legs and are expected back.
Sourcepub fn relayer_health(&self) -> Arc<RelayerHealth> ⓘ
pub fn relayer_health(&self) -> Arc<RelayerHealth> ⓘ
The per-relayer health, judged from reply races and published into the graph.
Sourcepub fn age_write_offs(&self)
pub fn age_write_offs(&self)
Ages the write-offs: drops what the counterparty has spent by now (see WRITE_OFF_HORIZON), the
write-off of relayers that recovered, and the re-bump marks that ran out. Touches only the small
per-session maps, so it is cheap and runs on every flush.
Sourcepub(crate) fn dead_stock(&self) -> Vec<StockThroughDead>
pub(crate) fn dead_stock(&self) -> Vec<StockThroughDead>
The outstanding SURBs whose return path runs through a relayer confirmed dead, in one walk of the pending map.
A snapshot, taken shard by shard: SURBs minted, spent or evicted during the walk may or may not
be in it, which write_off tolerates by re-checking each before acting.
Empty without a walk when no relayer is confirmed dead.
The walk is over every record of the map: measured at about 20 ns per record, so some 9 ms at the
256 MiB default and 20 ms for a million records. It repeats on every flush tick for as long as any relayer is
known dead, which for a relayer that stays dead is for good: probation ends only when a reply comes home
through the relayer. The flush therefore runs it on the blocking pool and only while a relayer is known dead
(RelayerHealth::any_known_dead), not on a runtime worker.
Sourcepub fn write_off_dead(&self) -> Vec<HoprPseudonym> ⓘ
pub fn write_off_dead(&self) -> Vec<HoprPseudonym> ⓘ
Moves outstanding SURBs whose return path runs through a relayer judged dead, or on probation after
such a verdict, into the per-session write-off, and drops the write-off of relayers that
recovered. This is age_write_offs, dead_stock and
write_off in a row; the flush runs them separately, so that the walk is
skipped when no relayer is dead.
Only the SURBs through the relayer are written off, and only they are counted: the counterparty’s other SURBs are as good as ever until the caller supersedes the whole stock. A relayer on probation is known dead all the same: the probes the planner’s exploration sends through it are written off like any other SURB through it.
Returns the sessions a dead verdict reached for the first time, see write_off.
Sourcepub(crate) fn write_off(
&self,
stock: Vec<StockThroughDead>,
) -> Vec<HoprPseudonym> ⓘ
pub(crate) fn write_off( &self, stock: Vec<StockThroughDead>, ) -> Vec<HoprPseudonym> ⓘ
Writes off stock, as found by dead_stock, and returns the sessions a
dead verdict reached for the first time, i.e. the ones for which a relayer has SURBs outstanding
that were not written off before. The counterparty cannot tell which of the SURBs it holds run
through the dead relayer, since it sees only their first hop, so the caller advances each such
session’s SURB generation and the counterparty drops its whole stock on the next push. The
write-off of such a session is dropped at the end of the pass: the wipe takes exactly the SURBs
it counted, and the balancer’s reset and paced refill replace them, so counting them on would only
make the balancer produce that many SURBs above the target for good. The SURBs through the relayer
minted after the wipe are written off anew on later passes, and the count stays small and current.
A verdict is acted on only once it has held for VERDICT_CONFIRMATION: a relayer judged dead in
this flush is written off and bumped at the next one, if it is still dead then. The stock is a
snapshot and a reply may revive its relayer while it is being worked through, so each SURB is
checked against the verdict and the relayer’s death again just before it is acted on, and the
death that check reads is the one that tells a probe from stock below. A death found missing
cancels the write-off like a lapsed verdict, even with the verdict still standing: that is a
revival caught half way. Taken for no death at all instead, it would make a revived relayer’s
probe stock, and an unreached session’s whole generation would be wiped for it.
Only stock reports a session: a SURB minted through the relayer before it was judged dead, which
the counterparty may hold. One minted after is a probe the planner’s exploration sent through a
relayer published at zero or on probation, and is written off without a report. That holds in
a session the wipe never reached too, one opened since or with nothing through the relayer at
the time, which has no mark for the pair: its first probe must not cost it its stock.
A (session, relayer) pair is reported once while the relayer is known dead, and after a reply
revives it once per REBUMP_COOLDOWN from the revival: a verdict reached again inside either
is written off as usual but reports nothing.
Sourcepub fn invalid(&self) -> HashMap<HoprPseudonym, (u64, f64)>
pub fn invalid(&self) -> HashMap<HoprPseudonym, (u64, f64)>
Per session, how many SURBs held by the counterparty cannot bring a reply home, and their share of all it was handed that are still accounted for.
Walks the whole pending map to count what is outstanding per session, as does
dead_stock. Called only while some session has written-off SURBs
(has_write_offs), which lasts as long as a relayer stays dead and
SURBs keep being minted through it, so on every flush tick for a permanently dead one. At the
256 MiB default the walk takes some 10 ms (see dead_stock), so the flush runs it on the
blocking pool, not on a runtime worker and not on the packet hot path.
Sourcepub fn forget_session(&self, pseudonym: &HoprPseudonym)
pub fn forget_session(&self, pseudonym: &HoprPseudonym)
Drops the write-off and the re-bump cooldown of a session that no longer exists.
Sourcepub fn record_observed(&self, paths: ForwardAndReturnPath, count: u64)
pub fn record_observed(&self, paths: ForwardAndReturnPath, count: u64)
Records that count replies arrived over these legs.
Trait Implementations§
Source§impl Clone for SurbRoundTripRegistry
impl Clone for SurbRoundTripRegistry
Source§fn clone(&self) -> SurbRoundTripRegistry
fn clone(&self) -> SurbRoundTripRegistry
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 SurbRoundTripRegistry
impl Debug for SurbRoundTripRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for SurbRoundTripRegistry
impl !UnwindSafe for SurbRoundTripRegistry
impl Freeze for SurbRoundTripRegistry
impl Send for SurbRoundTripRegistry
impl Sync for SurbRoundTripRegistry
impl Unpin for SurbRoundTripRegistry
impl UnsafeUnpin for SurbRoundTripRegistry
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<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.