pub trait QueryStrategy<IR, OR = IR> {
    // Required method
    fn process(
        &mut self,
        peer_id: PeerId,
        response: PeerResult<IR>
    ) -> QueryStep<OR>;

    // Provided methods
    fn request_timeout(&self) -> Option<Duration> { ... }
    fn with_request_timeout(
        self,
        timeout: Duration
    ) -> QueryStrategyWithRequestTimeout<Self, IR, OR>
       where Self: Sized { ... }
}
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§

source

fn process( &mut self, peer_id: PeerId, response: PeerResult<IR> ) -> QueryStep<OR>

Provided Methods§

source

fn request_timeout(&self) -> Option<Duration>

Should requests for this strategy have specific timeouts?

source

fn with_request_timeout( self, timeout: Duration ) -> QueryStrategyWithRequestTimeout<Self, IR, OR>
where Self: Sized,

Implementors§