pub struct BankWithScheduler { }
Expand description
Very thin wrapper around Arc
It brings type-safety against accidental mixing of bank and scheduler with different slots,
which is a pretty dangerous condition. Also, it guarantees to call wait_for_termination() via
::drop() inside BankForks::set_root()’s pruning, perfectly matching to Arc’s lifetime by
piggybacking on the pruning.
Semantically, a scheduler is tightly coupled with a particular bank. But scheduler wasn’t put
into Bank fields to avoid circular-references (a scheduler needs to refer to its accompanied
Arc). BankWithScheduler behaves almost like Arc. It only adds a few of transaction
scheduling and scheduler management functions. For this reason, bank
variable names should be
used for BankWithScheduler
across codebase.
BankWithScheduler even implements Deref for convenience. And Clone is omitted to implement to
avoid ambiguity as to which to clone: BankWithScheduler or Arc. Use
clone_without_scheduler() for Arc. Otherwise, use clone_with_scheduler() (this should be
unusual outside scheduler code-path)
Formats the value using the given formatter.
Read more
The resulting type after dereferencing.
Dereferences the value.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Instruments this type with the provided
Span
, returning an
Instrumented
wrapper.
Read more
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer.
Read more
Mutably dereferences the given pointer.
Read more
Drops the object pointed to by the given pointer.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.