pub trait QueryStrategy<IR, OR = IR> {
// Required method
fn process(&mut self, peer_id: PeerId, response: IR) -> QueryStep<OR>;
// Provided method
fn process_error(
&mut self,
_peer_id: PeerId,
_error: &ServerError,
) -> QueryStep<OR> { ... }
}Expand description
Fedimint query strategy
Due to federated security model each Fedimint client API call to the Federation might require a different way to process one or more required responses from the Federation members. This trait abstracts away the details of each specific strategy for the generic client Api code.
Required Methods§
Provided Methods§
Sourcefn process_error(
&mut self,
_peer_id: PeerId,
_error: &ServerError,
) -> QueryStep<OR>
fn process_error( &mut self, _peer_id: PeerId, _error: &ServerError, ) -> QueryStep<OR>
Called when a peer’s request fails, so a strategy can tell “still waiting” apart from “will never answer”.
Defaults to QueryStep::Continue, leaving failed peers entirely to
the caller’s error accounting, which is what every strategy other than
ThresholdAgreement wants.