packitup is a simple Rust library that implements various bin packing algorithms
```rust use packitup::offline::firstfitdecreasing::firstfitdecreasing;
struct MyItem { some_content: i32, size: usize, }
impl Pack for MyItem { fn size(&self) -> usize { self.size } }
fn main() { let myitems = vec![ MyItem { somecontent: 1, size: 1, }, MyItem { somecontent: 2, size: 2, }, MyItem { somecontent: 3, size: 19, }, MyItem { somecontent: 4, size: 17, }, MyItem { somecontent: 5, size: 1, }, ];
let mut bins = first_fit_decreasing(20, my_items);
} ```
The above will result in 2 full bins, one with sizes 19 and 1, and the other with sizes 17, 2 and 1.