pub struct BankWithScheduler { /* private fields */ }
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
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
Arcbank
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
Implementations§
source§impl BankWithScheduler
impl BankWithScheduler
pub fn new_without_scheduler(bank: Arc<Bank>) -> Self
pub fn clone_with_scheduler(&self) -> BankWithScheduler
pub fn clone_without_scheduler(&self) -> Arc<Bank>
pub fn register_tick(&self, hash: &Hash)
pub fn has_installed_scheduler(&self) -> bool
pub fn schedule_transaction_executions<'a>( &self, transactions_with_indexes: impl ExactSizeIterator<Item = (&'a SanitizedTransaction, &'a usize)>, )
pub fn wait_for_completed_scheduler(&self) -> Option<ResultWithTimings>
pub const fn no_scheduler_available() -> InstalledSchedulerRwLock
Trait Implementations§
source§impl Debug for BankWithScheduler
impl Debug for BankWithScheduler
Auto Trait Implementations§
impl Freeze for BankWithScheduler
impl !RefUnwindSafe for BankWithScheduler
impl Send for BankWithScheduler
impl Sync for BankWithScheduler
impl Unpin for BankWithScheduler
impl !UnwindSafe for BankWithScheduler
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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