pub struct IncomingTxBuilder<const RS: bool, const DBS: bool, Tx, TxId, PeerId> { /* private fields */ }
Expand description
An IncomingTx
builder.
The const generics here are used to restrict what methods can be called.
RS
: routing state; abool
for if the routing state is setDBS
: database state; abool
for if the state in the DB is set
Implementations§
Source§impl<Tx, TxId, PeerId> IncomingTxBuilder<false, false, Tx, TxId, PeerId>
impl<Tx, TxId, PeerId> IncomingTxBuilder<false, false, Tx, TxId, PeerId>
Sourcepub const fn new(tx: Tx, tx_id: TxId) -> Self
pub const fn new(tx: Tx, tx_id: TxId) -> Self
Creates a new IncomingTxBuilder
.
Source§impl<const DBS: bool, Tx, TxId, PeerId> IncomingTxBuilder<false, DBS, Tx, TxId, PeerId>
impl<const DBS: bool, Tx, TxId, PeerId> IncomingTxBuilder<false, DBS, Tx, TxId, PeerId>
Sourcepub fn with_routing_state(
self,
state: TxState<PeerId>,
) -> IncomingTxBuilder<true, DBS, Tx, TxId, PeerId>
pub fn with_routing_state( self, state: TxState<PeerId>, ) -> IncomingTxBuilder<true, DBS, Tx, TxId, PeerId>
Adds the routing state to the builder.
The routing state is the origin of this transaction from our perspective.
Source§impl<const RS: bool, Tx, TxId, PeerId> IncomingTxBuilder<RS, false, Tx, TxId, PeerId>
impl<const RS: bool, Tx, TxId, PeerId> IncomingTxBuilder<RS, false, Tx, TxId, PeerId>
Sourcepub fn with_state_in_db(
self,
state: Option<State>,
) -> IncomingTxBuilder<RS, true, Tx, TxId, PeerId>
pub fn with_state_in_db( self, state: Option<State>, ) -> IncomingTxBuilder<RS, true, Tx, TxId, PeerId>
Adds the database state to the builder.
If the transaction is not in the DB already then the state should be None
.
Source§impl<Tx, TxId, PeerId> IncomingTxBuilder<true, true, Tx, TxId, PeerId>
impl<Tx, TxId, PeerId> IncomingTxBuilder<true, true, Tx, TxId, PeerId>
Sourcepub fn build(self) -> Option<IncomingTx<Tx, TxId, PeerId>>
pub fn build(self) -> Option<IncomingTx<Tx, TxId, PeerId>>
Builds the IncomingTx
.
If this returns None
then the transaction does not need to be given to the dandelion pool
manager.
Auto Trait Implementations§
impl<const RS: bool, const DBS: bool, Tx, TxId, PeerId> Freeze for IncomingTxBuilder<RS, DBS, Tx, TxId, PeerId>
impl<const RS: bool, const DBS: bool, Tx, TxId, PeerId> RefUnwindSafe for IncomingTxBuilder<RS, DBS, Tx, TxId, PeerId>
impl<const RS: bool, const DBS: bool, Tx, TxId, PeerId> Send for IncomingTxBuilder<RS, DBS, Tx, TxId, PeerId>
impl<const RS: bool, const DBS: bool, Tx, TxId, PeerId> Sync for IncomingTxBuilder<RS, DBS, Tx, TxId, PeerId>
impl<const RS: bool, const DBS: bool, Tx, TxId, PeerId> Unpin for IncomingTxBuilder<RS, DBS, Tx, TxId, PeerId>
impl<const RS: bool, const DBS: bool, Tx, TxId, PeerId> UnwindSafe for IncomingTxBuilder<RS, DBS, Tx, TxId, PeerId>
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> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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.