pub struct TestBridge<M>where
M: Copy,{ /* private fields */ }Implementations§
Source§impl<M> TestBridge<M>where
M: Copy,
impl<M> TestBridge<M>where
M: Copy,
pub fn new(worker_count: usize, worker_req_cap: usize) -> Self
pub fn tx_count(&self) -> usize
pub fn contains_tx(&self, key: TransactionKey) -> bool
pub fn queue_progress(&mut self, progress: ProgressMessage)
pub fn queue_tpu(&mut self, tx: &VersionedTransaction)
pub fn queue_check_response_ok( &mut self, batch: &ScheduleBatch<Vec<KeyedTransactionMeta<M>>>, index: usize, keys: Option<Vec<Pubkey>>, )
pub fn queue_check_response( &mut self, batch: &ScheduleBatch<Vec<KeyedTransactionMeta<M>>>, index: usize, keys: Option<Vec<Pubkey>>, response: CheckResponse, )
pub fn queue_all_checks_ok(&mut self)
pub fn queue_execute_response( &mut self, batch: &ScheduleBatch<Vec<KeyedTransactionMeta<M>>>, index: usize, response: ExecutionResponse, )
pub fn queue_unprocessed_response( &mut self, batch: &ScheduleBatch<Vec<KeyedTransactionMeta<M>>>, index: usize, )
pub fn pop_schedule( &mut self, ) -> Option<ScheduleBatch<Vec<KeyedTransactionMeta<M>>>>
pub fn check_ok(&self) -> CheckResponse
pub fn execute_ok(&self) -> ExecutionResponse
pub fn execute_err(&self, reason: u8) -> ExecutionResponse
Methods from Deref<Target = SchedulerBindingsBridge<M>>§
pub fn allocator(&self) -> &Allocator
pub fn state(&self) -> &SlotMap<TransactionKey, TransactionState>
pub fn runtime(&self) -> &RuntimeState
pub fn progress(&self) -> &ProgressMessage
pub fn worker_count(&self) -> usize
Sourcepub fn worker(&mut self, id: usize) -> &mut SchedulerWorker
pub fn worker(&mut self, id: usize) -> &mut SchedulerWorker
Sourcepub fn transaction(&self, key: TransactionKey) -> &TransactionState
pub fn transaction(&self, key: TransactionKey) -> &TransactionState
Sourcepub fn insert_transaction(
&mut self,
tx: &[u8],
) -> Result<TransactionKey, TransactionInsertError>
pub fn insert_transaction( &mut self, tx: &[u8], ) -> Result<TransactionKey, TransactionInsertError>
pub fn drop_transaction(&mut self, key: TransactionKey)
pub fn drain_progress(&mut self) -> Option<ProgressMessage>
pub fn tpu_len(&mut self) -> usize
pub fn drain_tpu( &mut self, callback: impl FnMut(&mut Self, TransactionKey) -> TxDecision, max_count: usize, ) -> usize
pub fn drain_worker( &mut self, worker: usize, callback: impl FnMut(&mut Self, WorkerResponse<'_, M>) -> TxDecision, max_count: usize, )
Sourcepub fn schedule(
&mut self,
_: ScheduleBatch<&[KeyedTransactionMeta<M>]>,
) -> Result<(), ScheduleError>
pub fn schedule( &mut self, _: ScheduleBatch<&[KeyedTransactionMeta<M>]>, ) -> Result<(), ScheduleError>
Builds & schedules the provided batch.
§Panics
- If the worker index does not exist.
- If any transaction in the batch does not exist.
- If the batch size exceeds
MAX_TRANSACTIONS_PER_MESSAGE.
Trait Implementations§
Source§impl<M> Deref for TestBridge<M>where
M: Copy,
impl<M> Deref for TestBridge<M>where
M: Copy,
Auto Trait Implementations§
impl<M> !Send for TestBridge<M>
impl<M> !Sync for TestBridge<M>
impl<M> Freeze for TestBridge<M>where
SchedulerBindingsBridge<M>: Freeze,
impl<M> RefUnwindSafe for TestBridge<M>where
SchedulerBindingsBridge<M>: RefUnwindSafe,
impl<M> Unpin for TestBridge<M>where
SchedulerBindingsBridge<M>: Unpin,
impl<M> UnsafeUnpin for TestBridge<M>where
SchedulerBindingsBridge<M>: UnsafeUnpin,
impl<M> UnwindSafe for TestBridge<M>where
SchedulerBindingsBridge<M>: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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