pub fn push_back(
        &mut self,
        batch: BatchPair,
        force: bool,
    ) -> Result<(), PendingBatchQueueAppendError> {
        if !force && self.is_full() {
            Err(PendingBatchQueueAppendError::QueueFull(batch))
        } else if self.contains(batch.batch().header_signature()) {
            Err(PendingBatchQueueAppendError::DuplicateBatch(batch))
        } else {
            self.ids.insert(batch.batch().header_signature().into());
            self.batches.push_back(batch);
            gauge!(PENDING_BATCH_GAUGE, self.batches.len() as i64);
            Ok(())
        }
    }
/// Adds a batch to the end of the queue
///
/// If `force`, the batch will be added to the queue even if it's full.
///
/// # Errors
///
/// * Returns `PendingBatchQueueAppendError::DuplicateBatch` if the batch is already in the
///   queue; the batch is returned with the error.
/// * Returns `PendingBatchQueueAppendError::QueueFull` if the queue is full; the batch is
///   returned with the error.
Adds a batch to the end of the queue
If `force`, the batch will be added to the queue even if it's full.
Adds a batch to the end of the queue If ` force ` the batch will be added to the queue even if it ' s full .
pub fn push_back(
        &mut self,
        batch: BatchPair,
        force: bool,
    ) -> Result<(), PendingBatchQueueAppendError> {
        if !force && self.is_full() {
            Err(PendingBatchQueueAppendError::QueueFull(batch))
        } else if self.contains(batch.batch().header_signature()) {
            Err(PendingBatchQueueAppendError::DuplicateBatch(batch))
        } else {
            self.ids.insert(batch.batch().header_signature().into());
            self.batches.push_back(batch);
            gauge!(PENDING_BATCH_GAUGE, self.batches.len() as i64);
            Ok(())
        }
    }
pub fn push_back ( & mut self , batch : BatchPair , force : bool , ) -> Result < ( ) , PendingBatchQueueAppendError > { if ! force && self . is_full ( ) { Err ( PendingBatchQueueAppendError :: QueueFull ( batch ) ) } else if self . contains ( batch . batch ( ) . header_signature ( ) ) { Err ( PendingBatchQueueAppendError :: DuplicateBatch ( batch ) ) } else { self . ids . insert ( batch . batch ( ) . header_signature ( ) . into ( ) ) ; self . batches . push_back ( batch ) ; gauge ! ( PENDING_BATCH_GAUGE self batches len ( ) as i64 ) ; Ok ( ( ) ) } }
Adds a batch to the end of the queue
If `force`, the batch will be added to the queue even if it's full.
Adds a batch to the end of the queue If ` force ` the batch will be added to the queue even if it ' s full .
&mut self
batch
BatchPair
force
bool
&mut self
batch
BatchPair
force
bool
errors
Returns `PendingBatchQueueAppendError::DuplicateBatch` if the batch is already in the
queue; the batch is returned with the error.
Returns `PendingBatchQueueAppendError::QueueFull` if the queue is full; the batch is
returned with the error.
Returns ` PendingBatchQueueAppendError :: DuplicateBatch ` if the batch is already in the queue ; the batch is returned with the error . Returns ` PendingBatchQueueAppendError :: QueueFull ` if the queue is full ; the batch is returned with the error .