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() by DropBankService, which receives Vec
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
Sourcepub fn schedule_transaction_executions(
&self,
transactions_with_indexes: impl ExactSizeIterator<Item = (SanitizedTransaction, usize)>,
) -> Result<()>
pub fn schedule_transaction_executions( &self, transactions_with_indexes: impl ExactSizeIterator<Item = (SanitizedTransaction, usize)>, ) -> Result<()>
Schedule the transaction as long as the scheduler hasn’t been aborted.
If the scheduler has been aborted, this doesn’t schedule the transaction, instead just return the error of prior scheduled transaction.
Calling this will panic if the installed scheduler is Unavailable (the bank is wait_for_termination()-ed or the unified scheduler is disabled in the first place).
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