Skip to main content

BalancerStateValues

Struct BalancerStateValues 

Source
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: AtomicU64

SURBs 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: AtomicU64

How 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: AtomicBool

Whether 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: AtomicU64

The 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: AtomicU64

Consecutive reported levels that did not rise while below target – the plateau hysteresis behind observed_counterparty_capacity.

§counterparty_wiped: AtomicBool

Set 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: AtomicU64

Paces 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: AtomicU64

This 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: AtomicU64

This 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: AtomicBool

Set 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: ActivityEpoch

The instant last_heard and last_sent count from.

§last_heard: AtomicU64

When 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: AtomicU64

When a Session data packet last went out, in the same unit as last_heard.

§sending_since: AtomicU64

When 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: AtomicU64

When 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: AtomicU64

When 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: AtomicU64

Entry-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: AtomicU64

The 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: AtomicBool

Exit-side: whether the Entry has shown that it refills this side’s SURB stock. See counterparty_refills.

Implementations§

Source§

impl BalancerStateValues

Source

pub fn new(cfg: SurbBalancerConfig) -> Self

Constructor from a SurbBalancerConfig.

Source

pub fn update(&self, cfg: &SurbBalancerConfig)

Performs update of the BalancerStateValues from the SurbBalancerConfig and enables it.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn take_correction_cap(&self) -> bool

Takes the one-shot request to hold the next output to the pacing rate, if there is one.

Source

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.

Source

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.

Source

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.

Source

pub(crate) fn note_heard(&self)

Records that the counterparty was heard from now.

Source

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.

Source

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).

Source

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.

Source

pub(crate) fn note_reply_heard(&self)

Records that a reply the estimator counted as consumed came home now.

Source

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.

Source

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.

Source

fn stamp(&self, slot: &AtomicU64, at: Instant)

Stamps slot with at, never moving it back.

Source

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.

Source

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).

Source

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.

Source

fn take_counterparty_wiped(&self) -> bool

Takes the one-shot request to restart the level estimate from empty, if there is one.

Source

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.

Source

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.

Source

pub fn set_invalid_surbs(&self, count: u64, share: f64)

Sets how many stored SURBs are invalid and their share of what is outstanding.

Source

fn usable_level(&self, level: u64) -> u64

The part of level that can still bring a reply home.

Source

pub fn as_config(&self) -> SurbBalancerConfig

Extracts the SurbBalancerConfig from the BalancerStateValues.

Source

pub fn is_disabled(&self) -> bool

Checks if SURB balancing is disabled (no target buffer size set).

Source

pub fn surb_decay(&self) -> Option<(Duration, f64)>

Extracts the SURB decay configuration from the BalancerStateValues.

Source

pub fn buffer_level(&self) -> u64

Gets the current estimated SURB buffer level.

Source

pub fn controller_bounds(&self) -> BalancerControllerBounds

Returns the current BalancerControllerBounds from the BalancerStateValues.

Trait Implementations§

Source§

impl Debug for BalancerStateValues

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BalancerStateValues

Source§

fn default() -> BalancerStateValues

Returns the “default value” for a type. Read more
Source§

impl From<SurbBalancerConfig> for BalancerStateValues

Source§

fn from(cfg: SurbBalancerConfig) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 T
where T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows 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) -> R
where R: 'a,

Mutably borrows 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
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more