pub struct SolverCompetition {
pub auction_id: Option<i64>,
pub auction_start_block: Option<u64>,
pub auction_deadline_block: Option<u64>,
pub transaction_hashes: Option<Vec<String>>,
pub auction: Option<CompetitionAuction>,
pub solutions: Option<Vec<SolverSettlement>>,
}Expand description
Solver competition response from GET /api/v1/solver_competition/{auctionId}.
Contains the full details of which solvers participated, their proposed solutions, and which solution won the auction.
Fields§
§auction_id: Option<i64>Auction ID this competition corresponds to.
auction_start_block: Option<u64>Block at which the auction started.
auction_deadline_block: Option<u64>Deadline block by which the auction must be settled.
transaction_hashes: Option<Vec<String>>Transaction hashes for the winning solutions.
auction: Option<CompetitionAuction>The orders and prices that made up the competition auction.
solutions: Option<Vec<SolverSettlement>>All solutions submitted by solvers, in ascending score order.
Implementations§
Source§impl SolverCompetition
impl SolverCompetition
Sourcepub const fn has_auction_id(&self) -> bool
pub const fn has_auction_id(&self) -> bool
Returns true if an auction ID is available.
Sourcepub const fn has_start_block(&self) -> bool
pub const fn has_start_block(&self) -> bool
Returns true if the auction start block is available.
Sourcepub const fn has_deadline_block(&self) -> bool
pub const fn has_deadline_block(&self) -> bool
Returns true if the auction deadline block is available.
Sourcepub fn is_settled(&self) -> bool
pub fn is_settled(&self) -> bool
Returns true if there are on-chain settlement transaction hashes
(indicating the competition has been settled on-chain).
Sourcepub const fn has_auction(&self) -> bool
pub const fn has_auction(&self) -> bool
Returns true if the competition auction data is available.
Sourcepub const fn has_solutions(&self) -> bool
pub const fn has_solutions(&self) -> bool
Returns true if solver solutions are available.
Sourcepub fn num_solutions(&self) -> usize
pub fn num_solutions(&self) -> usize
Returns the number of solver solutions, or 0 if unavailable.
Sourcepub fn winning_solution(&self) -> Option<&SolverSettlement>
pub fn winning_solution(&self) -> Option<&SolverSettlement>
Returns a reference to the winning solution, if one exists.
Searches through all solutions and returns the first one where
SolverSettlement::is_winner is true.
Sourcepub const fn has_transaction_hashes(&self) -> bool
pub const fn has_transaction_hashes(&self) -> bool
Returns true if on-chain settlement transaction hashes are available.
This indicates the competition has been settled on-chain.
Trait Implementations§
Source§impl Clone for SolverCompetition
impl Clone for SolverCompetition
Source§fn clone(&self) -> SolverCompetition
fn clone(&self) -> SolverCompetition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SolverCompetition
impl Debug for SolverCompetition
Source§impl<'de> Deserialize<'de> for SolverCompetition
impl<'de> Deserialize<'de> for SolverCompetition
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SolverCompetition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SolverCompetition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for SolverCompetition
impl Display for SolverCompetition
Source§impl Serialize for SolverCompetition
impl Serialize for SolverCompetition
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for SolverCompetition
impl RefUnwindSafe for SolverCompetition
impl Send for SolverCompetition
impl Sync for SolverCompetition
impl Unpin for SolverCompetition
impl UnsafeUnpin for SolverCompetition
impl UnwindSafe for SolverCompetition
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,
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.