Struct ckb_tx_pool::service::TxPoolServiceBuilder
source · [−]pub struct TxPoolServiceBuilder { /* private fields */ }
Expand description
A builder used to create TxPoolService.
Implementations
sourceimpl 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>
) -> (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>
) -> (TxPoolServiceBuilder, TxPoolController)
Creates a new TxPoolServiceBuilder.
sourcepub fn register_pending(
&mut self,
callback: Box<dyn Fn(&mut TxPool, &TxEntry) + Sync + Send>
)
pub fn register_pending(
&mut self,
callback: Box<dyn Fn(&mut TxPool, &TxEntry) + Sync + Send>
)
Register new pending callback
sourcepub fn register_proposed(
&mut self,
callback: Box<dyn Fn(&mut TxPool, &TxEntry, bool) + Sync + Send>
)
pub fn register_proposed(
&mut self,
callback: Box<dyn Fn(&mut TxPool, &TxEntry, bool) + Sync + Send>
)
Register new proposed callback
sourcepub fn register_committed(
&mut self,
callback: Box<dyn Fn(&mut TxPool, &TxEntry) + Sync + Send>
)
pub fn register_committed(
&mut self,
callback: Box<dyn Fn(&mut TxPool, &TxEntry) + Sync + Send>
)
Register new committed 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 !RefUnwindSafe for TxPoolServiceBuilder
impl Send for TxPoolServiceBuilder
impl Sync for TxPoolServiceBuilder
impl Unpin for TxPoolServiceBuilder
impl !UnwindSafe for TxPoolServiceBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more