Expand description
IndexSort
§Installation
[dependencies]
indexsort = "0.1"§Example
- See
dtlogfor whenindexsortis more convenient thansort*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.
- Searchable
Ext - Extension trait for
T: Searchable. - Slice
Ext - Golang’s
sort.Slice,sort.SliceStableandsort.SliceIsSortedin Rust - Sortable
- Golang sort interface in Rust.
- Sortable
Ext - Extension trait for
T: Sortable.
Functions§
- search
- Golang’s
sort.Searchin 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.lento determine n andO(n*log(n))calls todata.lessanddata.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).