Trait iroh_bitswap::peer_task_queue::TaskMerger
source · pub trait TaskMerger<T: Topic, D: Data>: PartialEq + Eq + Clone + Debug + Send + Sync + 'static {
fn has_new_info(
&self,
task_info: &Task<T, D>,
existing_tasks: &[Task<T, D>]
) -> bool;
fn merge(&self, task: &Task<T, D>, existing: &mut Task<T, D>);
}Expand description
Trait that is used to merge new tasks into the active and pending queues.
Required Methods§
sourcefn has_new_info(
&self,
task_info: &Task<T, D>,
existing_tasks: &[Task<T, D>]
) -> bool
fn has_new_info(
&self,
task_info: &Task<T, D>,
existing_tasks: &[Task<T, D>]
) -> bool
Indicates whether the given task has more information than the existing group of tasks (which have the same Topic), and thus should be merged.