pub enum OptimizationOutcome {
Completed {
rounds_executed: u32,
},
InProgress,
}Expand description
Outcome of a [BreezSdk::optimize_leaves] call.
rounds_executed on Completed refers to rounds run by this call.
The SDK holds no cross-call state — callers driving a SingleRound
loop maintain their own cumulative counter if they need one.
A Completed { rounds_executed: 0 } outcome means the wallet was
already optimal at call time (no swap was needed).
SingleRound loop pattern: terminate on anything that isn’t
InProgress. Completed covers both the final swap of a productive
run and the “already optimal” no-op case (the latter as
rounds_executed: 0).
loop {
let request = OptimizeLeavesRequest { mode: OptimizationMode::SingleRound };
match sdk.optimize_leaves(request).await?.outcome {
OptimizationOutcome::InProgress => continue,
OptimizationOutcome::Completed { .. } => break,
}
}Variants§
Completed
All planned optimization work was executed in this call.
Returned by Full runs on success, and by SingleRound runs
whose swap was the final one needed (the planner produced a
single-swap plan with a convergence guarantee).
rounds_executed == 0 means the wallet was already optimal —
no work was performed.
InProgress
SingleRound only: a round ran but the planner could not
guarantee it was the last. The caller should invoke
optimize_leaves again.
Trait Implementations§
Source§impl Clone for OptimizationOutcome
impl Clone for OptimizationOutcome
Source§fn clone(&self) -> OptimizationOutcome
fn clone(&self) -> OptimizationOutcome
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OptimizationOutcome
impl Debug for OptimizationOutcome
Source§impl<'de> Deserialize<'de> for OptimizationOutcome
impl<'de> Deserialize<'de> for OptimizationOutcome
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>,
Source§impl From<OptimizationOutcome> for OptimizationOutcome
impl From<OptimizationOutcome> for OptimizationOutcome
Source§impl PartialEq for OptimizationOutcome
impl PartialEq for OptimizationOutcome
Source§impl Serialize for OptimizationOutcome
impl Serialize for OptimizationOutcome
impl StructuralPartialEq for OptimizationOutcome
Auto Trait Implementations§
impl Freeze for OptimizationOutcome
impl RefUnwindSafe for OptimizationOutcome
impl Send for OptimizationOutcome
impl Sync for OptimizationOutcome
impl Unpin for OptimizationOutcome
impl UnsafeUnpin for OptimizationOutcome
impl UnwindSafe for OptimizationOutcome
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request