pub struct TxPoolServiceBuilder { /* private fields */ }Expand description
A builder used to create TxPoolService.
Implementations§
Source§impl TxPoolServiceBuilder
impl TxPoolServiceBuilder
Sourcepub fn new(
tx_pool_config: TxPoolConfig,
snapshot: Arc<Snapshot>,
block_assembler_config: Option<BlockAssemblerConfig>,
txs_verify_cache: Arc<RwLock<TxVerificationCache>>,
handle: &Handle,
tx_relay_sender: Sender<TxVerificationResult>,
fee_estimator: FeeEstimator,
) -> (TxPoolServiceBuilder, TxPoolController)
pub fn new( tx_pool_config: TxPoolConfig, snapshot: Arc<Snapshot>, block_assembler_config: Option<BlockAssemblerConfig>, txs_verify_cache: Arc<RwLock<TxVerificationCache>>, handle: &Handle, tx_relay_sender: Sender<TxVerificationResult>, fee_estimator: FeeEstimator, ) -> (TxPoolServiceBuilder, TxPoolController)
Creates a new TxPoolServiceBuilder.
Sourcepub fn register_pending(
&mut self,
callback: Box<dyn Fn(&TxEntry) + Sync + Send>,
)
pub fn register_pending( &mut self, callback: Box<dyn Fn(&TxEntry) + Sync + Send>, )
Register new pending callback
Sourcepub fn tx_relay_sender(&self) -> Sender<TxVerificationResult>
pub fn tx_relay_sender(&self) -> Sender<TxVerificationResult>
Return cloned tx relayer sender
Sourcepub fn register_proposed(
&mut self,
callback: Box<dyn Fn(&TxEntry) + Sync + Send>,
)
pub fn register_proposed( &mut self, callback: Box<dyn Fn(&TxEntry) + Sync + Send>, )
Register new proposed callback
Sourcepub fn register_reject(
&mut self,
callback: Box<dyn Fn(&mut TxPool, &TxEntry, Reject) + Sync + Send>,
)
pub fn register_reject( &mut self, callback: Box<dyn Fn(&mut TxPool, &TxEntry, Reject) + Sync + Send>, )
Register new abandon callback
Sourcepub fn start(self, network: NetworkController)
pub fn start(self, network: NetworkController)
Start a background thread tx-pool service by taking ownership of the Builder, and returns a TxPoolController.
Auto Trait Implementations§
impl Freeze for TxPoolServiceBuilder
impl !RefUnwindSafe for TxPoolServiceBuilder
impl Send for TxPoolServiceBuilder
impl Sync for TxPoolServiceBuilder
impl Unpin for TxPoolServiceBuilder
impl UnsafeUnpin for TxPoolServiceBuilder
impl !UnwindSafe for TxPoolServiceBuilder
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> 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>
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