Crate indexsort

Source
Expand description

IndexSort

Yet another sort crate, porting Golang sort package to Rust.

github LoC Build codecov

docs.rs crates.io crates.io license

§Installation

[dependencies]
indexsort = "0.1"

§Example

  • See dtlog for when indexsort is more convenient than sort* in Rust’s standard library

§Acknowledgements

  • Porting Go’s sort package, thanks for Go contributors.

§License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Traits§

Searchable
Golang sort interface in Rust.
SearchableExt
Extension trait for T: Searchable.
SliceExt
Golang’s sort.Slice, sort.SliceStable and sort.SliceIsSorted in Rust
Sortable
Golang sort interface in Rust.
SortableExt
Extension trait for T: Sortable.

Functions§

search
Golang’s sort.Search in Rust.
slice_is_sorted
Returns whether the slice x is sorted according to the provided less function.
sort
Sort data. It makes one call to data.len to determine n and O(n*log(n)) calls to data.less and data.swap. The sort is not guaranteed to be stable.
sort_reverse
Sort data in reverse order.
sort_slice
Slice sorts the slice x given the provided less function.
sort_slice_stable
Sorts the slice data using the provided less function, keeping equal elements in their original order.
sort_stable
Sort data (stable).
sort_stable_reverse
Sort data in reverse order (stable).