pub struct BalancerStateValues {Show 24 fields
pub target_surb_buffer_size: AtomicU64,
pub max_surbs_per_sec: AtomicU64,
pub decay_duration_msec: AtomicU64,
pub decay_volume_pct: AtomicU8,
pub buffer_level: AtomicU64,
invalid_surbs: AtomicU64,
pub counterparty_buffer_capacity: AtomicU64,
pub counterparty_in_surb_distress: AtomicBool,
pub observed_counterparty_capacity: AtomicU64,
pub capacity_plateau_count: AtomicU64,
counterparty_wiped: AtomicBool,
refill_pacing: AtomicU64,
produced_before_lag: AtomicU64,
produced_at_update: AtomicU64,
correction_cap: AtomicBool,
epoch: ActivityEpoch,
last_heard: AtomicU64,
last_sent: AtomicU64,
sending_since: AtomicU64,
previous_run_ended: AtomicU64,
last_reply_heard: AtomicU64,
keep_alives_consumed: AtomicU64,
pacing_floor: AtomicU64,
counterparty_refills: AtomicBool,
}Expand description
Runtime state of the SurbBalancer.
Fields§
§target_surb_buffer_size: AtomicU64§max_surbs_per_sec: AtomicU64§decay_duration_msec: AtomicU64§decay_volume_pct: AtomicU8§buffer_level: AtomicU64§invalid_surbs: AtomicU64SURBs counted in buffer_level, held in the counterparty’s store, whose
return path runs through a relayer judged dead on any hop, and their share of what is outstanding:
count in the high and share (of u32::MAX) in the low 32 bits, so both are read together.
counterparty_buffer_capacity: AtomicU64How many SURBs the counterparty can physically hold, or 0 when unknown.
The level estimate is produced - consumed - evicted. The Exit observes its own store’s
evictions first-hand (num_evicted_surbs on each incoming packet) and counts them, so the
level it reports tracks what the store actually holds instead of growing without bound when a
return path drops replies – consumption alone is observed only once a reply arrives, and
before evictions were counted the belief ran away (measured during an outage: 51 917 believed
against a 15 000-entry store).
This capacity still bounds the level, as defense-in-depth, via the max(capacity, target)
clamp below: it covers the paths that cannot see evictions – the Entry’s own
produced - consumed belief between the Exit’s reports, and any session whose capacity is
unknown. The bound is max(capacity, target) rather than capacity so a target above the
counterparty’s real store does not pin the error permanently negative and hold production at
maximum forever.
§When the store is smaller than the target
With an accurate level, a counterparty whose store is smaller than the target reports a level
that plateaus at its real capacity and never reaches target, which on its own would leave
organic production running and the full buffer evicting. That corner is closed by
observed_counterparty_capacity, which infers the real
capacity from the plateau and caps the effective target there. It is unreachable with
homogeneous configuration (target <= 2/3 of the store) in any case; it needs the Entry’s store
to exceed ~1.5x the Exit’s.
counterparty_in_surb_distress: AtomicBoolWhether the counterparty’s last packet said it was running low on SURBs of its own.
A plain flag with no deadline: a distress flag that is never withdrawn merely keeps organic production at one SURB per packet — the behaviour that predates the gate — so it does not need to expire.
It clears on its own in the normal case: the counterparty recomputes both SURB signals on every return packet and strips them once its pool recovers, so the next healthy packet resets this.
observed_counterparty_capacity: AtomicU64The counterparty’s real store capacity, inferred from where its reported level plateaus, or
0 when not yet inferred.
Closes the capacity < target corner noted on
counterparty_buffer_capacity: when the reported level
stops rising while the Entry is still minting toward the target and the counterparty is not in
distress, its store is full at a level below the target, and that level is its real capacity.
organic_surbs_per_packet then stops production at
min(target, this) instead of a target the store can never reach.
Biased hard against firing, since a false positive under-supplies the counterparty (see the
destructive-recovery note in the SURB balancer gotchas): it takes several consecutive
non-rising reports (see observe_reported_level), and a
SurbDistress signal discards it
outright – a counterparty short of SURBs is not full. Set back to 0 (re-probe) if the level
later rises above it.
capacity_plateau_count: AtomicU64Consecutive reported levels that did not rise while below target – the plateau hysteresis
behind observed_counterparty_capacity.
counterparty_wiped: AtomicBoolSet by on_counterparty_wiped, consumed by the next balancer
update: the counterparty dropped its whole stock, so that update restarts the level estimate
from empty.
A flag rather than a plain store of 0 into buffer_level because the
level has another writer: the update in flight, which would write back the level it loaded
before the reset. (The counterparty’s keep-alive is the other, which may still carry its
pre-wipe level; observe_reported_level drops such a report
while the refill is paced.)
refill_pacing: AtomicU64Paces the refill after a wipe: the rate in SURBs per second in the high 32 bits and the
milliseconds it still holds for in the low 32 bits, so both are read together. Zero is
inactive. See REFILL_PACING_SECS.
produced_before_lag: AtomicU64This side’s produced count as it was REPORT_LAG before the last balancer update, published by
every update from ProducedHistory: what a counterparty report arriving now cannot have seen
yet is the production since then. 0 until the first update.
produced_at_update: AtomicU64This side’s produced count at the last balancer update, published with
produced_before_lag. What is produced after it is the next update’s
to add, so a report adopted in between takes as in flight only the production up to it.
correction_cap: AtomicBoolSet when a report lowered the believed level, consumed by the next balancer update: that update’s output is held to the pacing rate, so that a correction never turns into a burst.
epoch: ActivityEpochThe instant last_heard and last_sent count from.
last_heard: AtomicU64When the counterparty was last heard from, in milliseconds since epoch plus one, so that 0
is “never”. Any packet from it counts, and so does a reply the estimator counted as consumed.
Entry-side only; see silence_sustain.
last_sent: AtomicU64When a Session data packet last went out, in the same unit as last_heard.
sending_since: AtomicU64When the current run of unanswered data began, in the same unit as last_heard:
the first packet sent after the counterparty was last heard. See
silence_sustain.
previous_run_ended: AtomicU64When the run of data before the current one ended, in the same unit as last_heard:
its last packet. The reply stream is judged against it; see silence_sustain.
last_reply_heard: AtomicU64When a reply the estimator counted as consumed last came home, in the same unit as
last_heard: what tells a reply stream that stopped from one that never was.
keep_alives_consumed: AtomicU64Entry-side: the SURBs the estimator counted as consumed for the counterparty’s keep-alives rather than for replies to data. Only ever grows.
pacing_floor: AtomicU64The fewest SURBs per second the paced fill and refill may be held to: one keep-alive’s worth,
set by the Session that owns the balancer. 0 until set. See pacing_cap.
counterparty_refills: AtomicBoolExit-side: whether the Entry has shown that it refills this side’s SURB stock. See
counterparty_refills.
Implementations§
Source§impl BalancerStateValues
impl BalancerStateValues
Sourcepub fn new(cfg: SurbBalancerConfig) -> Self
pub fn new(cfg: SurbBalancerConfig) -> Self
Constructor from a SurbBalancerConfig.
Sourcepub fn update(&self, cfg: &SurbBalancerConfig)
pub fn update(&self, cfg: &SurbBalancerConfig)
Performs update of the BalancerStateValues from the SurbBalancerConfig and
enables it.
Sourcepub fn set_counterparty_buffer_capacity(&self, capacity: u64)
pub fn set_counterparty_buffer_capacity(&self, capacity: u64)
Declares how many SURBs the counterparty’s store can hold, bounding the level estimate.
Taken from the session manager’s maximum_surb_buffer_size, which is the same capacity
already used to clamp a counterparty’s requested target. Zero leaves the estimate unbounded.
Sourcefn clamp_to_counterparty_capacity(&self, level: u64) -> u64
fn clamp_to_counterparty_capacity(&self, level: u64) -> u64
Caps level at what the counterparty can actually hold.
Never below the configured target: a target above the counterparty’s capacity is unreachable by construction, and clamping to capacity there would hold the error permanently negative and pin production at maximum forever – a worse failure than the unbounded estimate this exists to prevent. In that configuration the capacity figure is simply not usable for this session.
Sourcepub fn observe_counterparty_signals(&self, signals: PacketSignals)
pub fn observe_counterparty_signals(&self, signals: PacketSignals)
Records what the counterparty’s latest packet said about its own SURB supply.
Takes the whole signal set rather than a bool so the containment rule lives here: OutOfSurbs
is a superset of SurbDistress on the wire, so contains catches both, whereas an equality
match against SurbDistress would silently ignore the more severe of the two.
Sourcepub fn observe_reported_level(&self, new_level: u64)
pub fn observe_reported_level(&self, new_level: u64)
Records the SURB level the counterparty reported, net of the production it cannot have seen yet, and infers its real store capacity from a plateau in that level.
Called on every BalancerState keep-alive, including one that repeats the last value – a
level that stops rising while the Entry is still minting toward the target is the plateau
signal. See observed_counterparty_capacity.
The report was written REPORT_LAG or less ago, so the SURBs produced since then were still on
their way when it was written and are added to it: adopting a report as it stands pulls the
level below the truth by exactly that production. Only the production up to the last balancer
update is added here, though: the next update adds everything produced after that one to the
level in any case, and adding it here as well would count it twice. A report that still lowers
the believed level marks the next balancer update so that its output is held to the pacing
rate: a correction, not a deficit to burst for.
While the refill after a wipe is paced, every report is dropped, stored by neither the level nor the plateau bookkeeping: a report above the believed level is the counterparty reporting the stock it had before it saw the new SURB generation, and one below it is the stock it had before the refill in flight reached it, thousands short at the pacing rate. The level believed here during the window is the production since the reset, which is the truth by construction.
Sourcepub(crate) fn publish_production(&self, before_lag: u64, at_update: u64)
pub(crate) fn publish_production(&self, before_lag: u64, at_update: u64)
Publishes this side’s produced count as it was REPORT_LAG before this update and as it is at
this update, for observe_reported_level. Called by every
balancer update.
Sourcefn take_correction_cap(&self) -> bool
fn take_correction_cap(&self) -> bool
Takes the one-shot request to hold the next output to the pacing rate, if there is one.
Sourcepub(crate) fn pacing_cap(&self) -> u64
pub(crate) fn pacing_cap(&self) -> u64
The rate the fill and the refill after a wipe are held to: target / REFILL_PACING_SECS SURBs
per second, at least one keep-alive’s worth (set_pacing_floor) and
at least one, and never above max_surbs_per_sec.
The floor matters at small targets only: a keep-alive carries a fixed number of SURBs, so a fifth of a target of 11 is two SURBs a second, a keep-alive every four seconds, and a Session that waited for a quarter of its target opened after four seconds instead of under one. The ceiling is the bound the PID output had: the pacing replaces that output for its window, and must not exceed what the client configured the balancer to mint.
Sourcepub fn set_pacing_floor(&self, surbs_per_sec: u64)
pub fn set_pacing_floor(&self, surbs_per_sec: u64)
Sets the fewest SURBs per second the pacing may be held to: one keep-alive’s worth of SURBs, so
that a paced fill sends at least one keep-alive a second. See pacing_cap.
Sourcepub fn organic_surbs_per_packet(&self) -> usize
pub fn organic_surbs_per_packet(&self) -> usize
How many SURBs an outgoing Session data packet should carry along with its payload.
Entry-side only. BalancerStateValues is shared by both ends of a Session, but only the
initiator mints SURBs for its counterparty, so on the Exit this answer is meaningless.
Returning 0 is the point: a SURB delivered to a counterparty that is already at its target
evicts the oldest one it holds, and under PIX that destroys an SSA share rather than merely
wasting a SURB. Production resumes at one per packet as soon as the estimate falls back below
target, or immediately if the counterparty signals it is running low.
This uses the usable level: SURBs the counterparty holds through a relayer judged dead do not hold the gate shut.
Sourcepub(crate) fn note_heard(&self)
pub(crate) fn note_heard(&self)
Records that the counterparty was heard from now.
Sourcepub(crate) fn note_counterparty_refills(&self)
pub(crate) fn note_counterparty_refills(&self)
Records that the counterparty refills this side’s SURB stock. The Exit calls it on a keep-alive from the Entry other than a manual ping: only an Entry’s SURB balancer runs a keep-alive stream.
Sourcepub(crate) fn counterparty_refills(&self) -> bool
pub(crate) fn counterparty_refills(&self) -> bool
Whether the counterparty has shown that it refills this side’s SURB stock (see
note_counterparty_refills). An Entry without a SURB
balancer never does: it attaches one SURB to each data packet and sends no keep-alives of its own,
only the odd manual ping (an Entry that predates ManualPing and pings by hand still sets it).
Sourcepub(crate) fn note_sent(&self)
pub(crate) fn note_sent(&self)
Records that a Session data packet is going out now. The first one since the counterparty was last heard starts a new run of unanswered data, and the last packet before it ended the previous one.
Sourcepub(crate) fn note_reply_heard(&self)
pub(crate) fn note_reply_heard(&self)
Records that a reply the estimator counted as consumed came home now.
Sourcepub(crate) fn note_keep_alive_consumed(
&self,
estimator: &AtomicSurbFlowEstimator,
)
pub(crate) fn note_keep_alive_consumed( &self, estimator: &AtomicSurbFlowEstimator, )
Counts a SURB consumed by a counterparty keep-alive, not by a reply, in the estimator too.
The keep-alive count is written before consumed is released, and the estimator acquires consumed
when read, so a reader that sees the SURB also sees its keep-alive.
Sourcepub(crate) fn keep_alives_consumed(&self) -> u64
pub(crate) fn keep_alives_consumed(&self) -> u64
The number of consumed SURBs that were spent on counterparty keep-alives. See
note_keep_alive_consumed.
Sourcepub(crate) fn silence_sustain(&self) -> bool
pub(crate) fn silence_sustain(&self) -> bool
Whether data is going out into silence: the balancer is enabled, the counterparty was heard from
at least once, and data has been going out for more than SILENCE_SUSTAIN_AFTER since the first
packet sent after the last time it was. The window starts at that first unanswered packet, not at
the last word heard: an idle stretch leaves nothing unanswered, and the Exit gets the grace to
answer the data that ends it.
The Entry then keeps one SURB in each data packet it sends even though its level estimate is at
or above the target (see cap_organic_surbs in the session manager). The estimate is fed by the
Exit’s reports and replies; with none arriving it stays where it was, while the Exit goes on
answering the data it gets, one SURB for each reply, into a return path that may be delivering
nothing. The estimate then never falls below the target and the Entry mints nothing, until the
Exit’s stock is empty. The balancer’s own surb_decay is the exception: on by default (5 % of
the target per 60 s) it erodes the estimate each window, so at a data rate low enough that the
sustain’s one-SURB-per-packet production does not outpace it, the estimate falls below the
target within a decay window or two and the gate reopens without the sustain. One SURB per data
packet is what the Exit can be expected to spend and no more: the sustain is bounded by the rate
of the data, makes no burst, and wipes nothing. It ends at the first packet or reply from the
Exit.
Only a reply stream that stopped counts: the last reply must be within REPLY_STREAM_WINDOW of
the last data packet before the current run, that is, the Exit answered the data that went out
before. A Session the Exit does not answer hears only its reports, one per notify period, and
sustaining it would put one SURB in every data packet into a stock nothing spends, up to the
store’s capacity. The reports that arrive while nothing goes out do not age the reply stream: a
Session that was answered, went quiet, and whose return path failed meanwhile still gets the
sustain once it sends again.
Judged between the stamps, not against the clock, so that the answer is about the packet being
sent: it takes note_sent for that packet first.
Sourcepub fn on_counterparty_wiped(&self)
pub fn on_counterparty_wiped(&self)
Tells the state that the counterparty dropped every SURB it held, because the SURB generation of the session advanced and the counterparty clears its store on the first batch of the new one.
The level estimate restarts from empty at the next balancer update, and for
REFILL_PACING_SECS the refill is held to the pacing rate: a fifth of the target a second, at
least one keep-alive’s worth and never above max_surbs_per_sec (see pacing_cap).
The counterparty’s own reports follow suit once the first SURBs of the new generation reach
it. Until then it may still report the level it had before, and then the level before the
refill in flight reached it; for the paced window every report is dropped (see
observe_reported_level).
Sourcepub fn arm_refill_pacing(&self)
pub fn arm_refill_pacing(&self)
Holds the refill of an empty counterparty to the pacing rate (pacing_cap: a fifth of the target
a second, at least one keep-alive’s worth, never above max_surbs_per_sec) for
REFILL_PACING_SECS, whatever the PID would command. A disabled balancer arms nothing.
The second half of on_counterparty_wiped, and what the Entry
calls when its balancer starts: a session that has just been opened is in the same state as one
that has just been wiped, the counterparty holds nothing and the level estimate says so, and
the PID would command its ceiling just the same. Unlike a wipe it resets nothing: the estimate
is already empty, and what the first tick produced is the new session’s.
Sourcefn take_counterparty_wiped(&self) -> bool
fn take_counterparty_wiped(&self) -> bool
Takes the one-shot request to restart the level estimate from empty, if there is one.
Sourcepub(crate) fn refill_pacing_active(&self) -> bool
pub(crate) fn refill_pacing_active(&self) -> bool
Whether the refill after a wipe is still paced. Read-only: unlike pace_refill
it does not use up any of the window.
Sourcefn pace_refill(&self, elapsed: Duration) -> Option<u64>
fn pace_refill(&self, elapsed: Duration) -> Option<u64>
The cap on the control output while the refill after a wipe is paced, in SURBs per second, and
uses up elapsed of the pacing window. None when no pacing is active.
Sourcepub fn set_invalid_surbs(&self, count: u64, share: f64)
pub fn set_invalid_surbs(&self, count: u64, share: f64)
Sets how many stored SURBs are invalid and their share of what is outstanding.
Sourcefn usable_level(&self, level: u64) -> u64
fn usable_level(&self, level: u64) -> u64
The part of level that can still bring a reply home.
Sourcepub fn as_config(&self) -> SurbBalancerConfig
pub fn as_config(&self) -> SurbBalancerConfig
Extracts the SurbBalancerConfig from the BalancerStateValues.
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Checks if SURB balancing is disabled (no target buffer size set).
Sourcepub fn surb_decay(&self) -> Option<(Duration, f64)>
pub fn surb_decay(&self) -> Option<(Duration, f64)>
Extracts the SURB decay configuration from the BalancerStateValues.
Sourcepub fn buffer_level(&self) -> u64
pub fn buffer_level(&self) -> u64
Gets the current estimated SURB buffer level.
Sourcepub fn controller_bounds(&self) -> BalancerControllerBounds
pub fn controller_bounds(&self) -> BalancerControllerBounds
Returns the current BalancerControllerBounds from the BalancerStateValues.
Trait Implementations§
Source§impl Debug for BalancerStateValues
impl Debug for BalancerStateValues
Source§impl Default for BalancerStateValues
impl Default for BalancerStateValues
Source§fn default() -> BalancerStateValues
fn default() -> BalancerStateValues
Source§impl From<SurbBalancerConfig> for BalancerStateValues
impl From<SurbBalancerConfig> for BalancerStateValues
Source§fn from(cfg: SurbBalancerConfig) -> Self
fn from(cfg: SurbBalancerConfig) -> Self
Auto Trait Implementations§
impl !Freeze for BalancerStateValues
impl RefUnwindSafe for BalancerStateValues
impl Send for BalancerStateValues
impl Sync for BalancerStateValues
impl Unpin for BalancerStateValues
impl UnsafeUnpin for BalancerStateValues
impl UnwindSafe for BalancerStateValues
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
§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.