[−][src]Function snowball::snow_ball_loop
pub fn snow_ball_loop<L, N, NW, S, C, QC, QB, QR, Q, F, E>(
location: L,
network: NW,
sampler: S,
current_candidate: C,
candidates: HashSet<C>,
query_context: QC,
query_builder: QB,
acceptance_threshold: usize,
sample_size: u64,
query_threshold: usize,
query_filter: fn(query: Q, originating_node: &N) -> bool
) -> Result<C, E> where
L: Serialize + DeserializeOwned + PartialEq,
C: Candidate,
QC: QueryContext,
QR: QueryResponse<Candidate = C>,
Q: Query<Location = L, Context = QC, Candidate = C>,
N: Node<Query = Q, QueryResponse = QR, Error = E>,
NW: Network<Node = N>,
S: Sampler<SamplingType = u64, Error = E>,
QB: QueryBuilder<Context = QC, Location = L, Candidate = C, Query = Q>,
E: Error,
Snowball loop implements snow ball algorithm and identifies a candidate preferred by majority of nodes in the network.