Trait svgbob::Merge

source ·
pub trait Merge {
    // Required method
    fn merge(&self, other: &Self) -> Option<Self>
       where Self: Sized;

    // Provided methods
    fn merge_recursive(items: impl IntoIterator<Item = Self>) -> Vec<Self>
       where Self: Sized { ... }
    fn second_pass_merge(items: impl IntoIterator<Item = Self>) -> Vec<Self>
       where Self: Sized { ... }
}

Required Methods§

source

fn merge(&self, other: &Self) -> Option<Self>where Self: Sized,

An implementation for each implementing objects which creates a new instance merging self and the other item.

Provided Methods§

source

fn merge_recursive(items: impl IntoIterator<Item = Self>) -> Vec<Self>where Self: Sized,

Merge all items until the size don’t change

source

fn second_pass_merge(items: impl IntoIterator<Item = Self>) -> Vec<Self>where Self: Sized,

Iterate through each items in the group and merge that items that can be merged

Implementors§