pub enum TxOrdering {
Shuffle,
Untouched,
Custom {
input_sort: Arc<dyn Fn(&TxIn, &TxIn) -> Ordering + Send + Sync>,
output_sort: Arc<dyn Fn(&TxOut, &TxOut) -> Ordering + Send + Sync>,
},
}
Expand description
Ordering of the transaction’s inputs and outputs
Variants§
Shuffle
Randomized (default)
Untouched
Unchanged
Custom
Provide custom comparison functions for sorting
Implementations§
Source§impl TxOrdering
impl TxOrdering
Sourcepub fn sort_tx(&self, tx: &mut Transaction)
pub fn sort_tx(&self, tx: &mut Transaction)
Sort transaction inputs and outputs by TxOrdering
variant.
Uses the thread-local random number generator (rng).
Sourcepub fn sort_tx_with_aux_rand(
&self,
tx: &mut Transaction,
rng: &mut impl RngCore,
)
pub fn sort_tx_with_aux_rand( &self, tx: &mut Transaction, rng: &mut impl RngCore, )
Sort transaction inputs and outputs by TxOrdering
variant.
Uses a provided random number generator (rng).
Trait Implementations§
Source§impl Clone for TxOrdering
impl Clone for TxOrdering
Source§fn clone(&self) -> TxOrdering
fn clone(&self) -> TxOrdering
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TxOrdering
impl Debug for TxOrdering
Source§impl Default for TxOrdering
impl Default for TxOrdering
Source§fn default() -> TxOrdering
fn default() -> TxOrdering
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TxOrdering
impl !RefUnwindSafe for TxOrdering
impl Send for TxOrdering
impl Sync for TxOrdering
impl Unpin for TxOrdering
impl !UnwindSafe for TxOrdering
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