pub trait OutcomeExt<R>{
// Required methods
fn merge<T, F>(
self,
init: T,
merge: F,
) -> impl Future<Output = (T, Faults)> + Send
where T: Send,
F: Fn(T, R) -> T + Send;
fn grid<K, I, F>(self, extract: F) -> impl Future<Output = Grid<K>> + Send
where K: Ord + Send,
I: IntoIterator<Item = K>,
F: Fn(R) -> I + Send;
fn tally(self) -> impl Future<Output = Tally> + Send;
fn first_acceptable<F>(
self,
accept: F,
) -> impl Future<Output = Option<(OwnedServerName, R)>> + Send
where F: Fn(&R) -> bool + Send;
}Expand description
Adds terminal aggregations to a federation outcome stream.
Each fold preserves per-origin failures while applying caller policy only to successful typed responses.
Required Methods§
Sourcefn merge<T, F>(
self,
init: T,
merge: F,
) -> impl Future<Output = (T, Faults)> + Send
fn merge<T, F>( self, init: T, merge: F, ) -> impl Future<Output = (T, Faults)> + Send
Merges successful responses and retains per-origin faults.
Successful values are folded in completion order from the supplied seed.
Sourcefn grid<K, I, F>(self, extract: F) -> impl Future<Output = Grid<K>> + Send
fn grid<K, I, F>(self, extract: F) -> impl Future<Output = Grid<K>> + Send
Inverts extracted response data into origin sets.
Successful responses with no extracted data enter the empty-origin set.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".