Skip to main content

SurbRoundTripRegistry

Struct SurbRoundTripRegistry 

Source
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

Source

pub fn with_observer(self, observer: TransportObserver) -> Self

Report minted and returned SURBs to observer. Attach it before cloning this registry.

Source

fn record_minted( &self, paths: ForwardAndReturnPath, count: u64, destination: OffchainPublicKey, )

Notify the optional observer about minted SURBs independently of graph telemetry drains.

Source

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.

Source

fn from_maps( pending: RandomEvictionMap<PendingSurb>, written_off_legs: RandomEvictionMap<([Option<OffchainPublicKey>; 5], Instant)>, ) -> Self

Source

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.

Source

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

Source

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.

Source

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.

Source

pub fn has_write_offs(&self) -> bool

Whether some session has SURBs written off, which is when invalid has anything to report.

Source

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.

Source

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.

Source

fn counters(&self, paths: ForwardAndReturnPath) -> Arc<SurbRoundTripCounters> ⓘ

Source

pub fn record_expected(&self, paths: ForwardAndReturnPath, count: u64)

Records that count SURBs were minted over these legs and are expected back.

Source

pub fn relayer_health(&self) -> Arc<RelayerHealth> ⓘ

The per-relayer health, judged from reply races and published into the graph.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn forget_session(&self, pseudonym: &HoprPseudonym)

Drops the write-off and the re-bump cooldown of a session that no longer exists.

Source

pub fn record_observed(&self, paths: ForwardAndReturnPath, count: u64)

Records that count replies arrived over these legs.

Source

pub fn drain(&self) -> Vec<(ForwardAndReturnPath, u64, u64)>

Takes every non-empty entry, resetting the counts.

Trait Implementations§

Source§

impl Clone for SurbRoundTripRegistry

Source§

fn clone(&self) -> SurbRoundTripRegistry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SurbRoundTripRegistry

Source§

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

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

impl Default for SurbRoundTripRegistry

Source§

fn default() -> Self

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

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,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Conv for T

§

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

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

impl<T> DynClone for T
where T: Clone,

§

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.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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