Struct cuprate_dandelion_tower::pool::IncomingTx

source ·
pub struct IncomingTx<Tx, TxID, PID> {
    pub tx: Tx,
    pub tx_id: TxID,
    pub tx_state: TxState<PID>,
}
Expand description

An incoming transaction for the DandelionPool to handle.

Users may notice there is no way to check if the dandelion-pool wants a tx according to an inventory message like seen in Bitcoin, only having a request for a full tx. Users should look in the public backing pool to handle inv messages, and request txs even if they are in the stem pool.

Fields§

§tx: Tx

The transaction.

It is recommended to put this in an Arc as it needs to be cloned to send to the backing tx pool and DandelionRouter

§tx_id: TxID

The transaction ID.

§tx_state: TxState<PID>

The routing state of this transaction.

Trait Implementations§

source§

impl<Tx, TxID, PID> Service<IncomingTx<Tx, TxID, PID>> for DandelionPoolService<Tx, TxID, PID>
where Tx: Clone + Send, TxID: Hash + Eq + Clone + Send + 'static, PID: Hash + Eq + Clone + Send + 'static,

§

type Response = ()

Responses given by the service.
§

type Error = DandelionPoolShutDown

Errors produced by the service.
§

type Future = Pin<Box<dyn Future<Output = Result<<DandelionPoolService<Tx, TxID, PID> as Service<IncomingTx<Tx, TxID, PID>>>::Response, <DandelionPoolService<Tx, TxID, PID> as Service<IncomingTx<Tx, TxID, PID>>>::Error>> + Send>>

The future response value.
source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call(&mut self, req: IncomingTx<Tx, TxID, PID>) -> Self::Future

Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

§

impl<Tx, TxID, PID> Freeze for IncomingTx<Tx, TxID, PID>
where Tx: Freeze, TxID: Freeze, PID: Freeze,

§

impl<Tx, TxID, PID> RefUnwindSafe for IncomingTx<Tx, TxID, PID>
where Tx: RefUnwindSafe, TxID: RefUnwindSafe, PID: RefUnwindSafe,

§

impl<Tx, TxID, PID> Send for IncomingTx<Tx, TxID, PID>
where Tx: Send, TxID: Send, PID: Send,

§

impl<Tx, TxID, PID> Sync for IncomingTx<Tx, TxID, PID>
where Tx: Sync, TxID: Sync, PID: Sync,

§

impl<Tx, TxID, PID> Unpin for IncomingTx<Tx, TxID, PID>
where Tx: Unpin, TxID: Unpin, PID: Unpin,

§

impl<Tx, TxID, PID> UnwindSafe for IncomingTx<Tx, TxID, PID>
where Tx: UnwindSafe, TxID: UnwindSafe, PID: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.