pub struct ResolveJob {
pub original_tir: AnyTir,
pub args: ArgMap,
pub compiler: Value,
pub round: usize,
pub last_eval: Option<CompiledTx>,
pub converged: bool,
pub log: Vec<ResolveLogEntry>,
pub input_queries: Vec<QueryResolution>,
pub input_pool: Option<HashMap<UtxoRef, Utxo>>,
}Fields§
§original_tir: AnyTir§args: ArgMap§compiler: Value§round: usize§last_eval: Option<CompiledTx>§converged: bool§log: Vec<ResolveLogEntry>§input_queries: Vec<QueryResolution>§input_pool: Option<HashMap<UtxoRef, Utxo>>Implementations§
Source§impl ResolveJob
impl ResolveJob
Sourcepub fn approximate_queries(&mut self)
pub fn approximate_queries(&mut self)
For each query, filter the pool by hard constraints, rank by closeness to the target asset composition, then filter by aggregate constraints.
Source§impl ResolveJob
impl ResolveJob
Sourcepub fn assign_all(&mut self) -> Result<(), Error>
pub fn assign_all(&mut self) -> Result<(), Error>
Given queries with their ranked candidates (from the approximation stage), find an allocation that satisfies all queries simultaneously using greedy assignment. Returns an error if any query cannot be resolved.
Source§impl ResolveJob
impl ResolveJob
Source§impl ResolveJob
impl ResolveJob
Source§impl ResolveJob
impl ResolveJob
pub fn new(tx: AnyTir, args: ArgMap) -> Self
pub fn record(&mut self, event: ResolveLog)
pub fn resolved_tir(&self) -> &AnyTir
pub fn set_input_queries(&mut self, queries: Vec<(String, CanonicalQuery)>)
pub fn pool_refs(&self) -> Vec<UtxoRef>
pub fn to_input_map(&self) -> BTreeMap<String, UtxoSet>
pub async fn execute<C, S>( &mut self, compiler: &mut C, utxos: &S, max_optimize_rounds: usize, ) -> Result<CompiledTx, Error>
Trait Implementations§
Source§impl Clone for ResolveJob
impl Clone for ResolveJob
Source§fn clone(&self) -> ResolveJob
fn clone(&self) -> ResolveJob
Returns a duplicate 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 ResolveJob
impl Debug for ResolveJob
Source§impl<'de> Deserialize<'de> for ResolveJob
impl<'de> Deserialize<'de> for ResolveJob
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DiagnosticDump for ResolveJob
impl DiagnosticDump for ResolveJob
Auto Trait Implementations§
impl Freeze for ResolveJob
impl RefUnwindSafe for ResolveJob
impl Send for ResolveJob
impl Sync for ResolveJob
impl Unpin for ResolveJob
impl UnsafeUnpin for ResolveJob
impl UnwindSafe for ResolveJob
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