docs.rs failed to build underscore-0.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
overview
underscore-rust is utility library for rust. Inspired by underscore.js.
usage
underscore-rust expands std library. You can use the same as standard library.
pub use VecU;
let sample = vec!;
assert_eq!;
pub use HashMapU;
let mut sample = new;
sample.insert;
sample.insert;
let inverted = sample.invert;
// => HashMap { 1u: 1i, 2u: 2i }
pub use BTreeMapU;
let mut sample = new;
sample.insert;
sample.insert;
let inverted = sample.invert;
// => BTreeMap { 1u: 1i, 2u: 2i }
underscore-rust now expands only Vec
, HashMap
, BTreeMap
.
document
detail document is here.
std library
rust already has many functions of underscore.js at std library. If you are looking for them, take a look at official document.
- initial
- collections::vec::Vec::init
- last
- collections::vec::Vec::last
- rest
- collections::vec::Vec::tailn
- union
- collections::vec::Vec::add
- range
- std::iter::range
- map
- std::iter::Map::map
- reduce
- std::iter::Scan::scan
- find
- std::iter::Filter::find
- filter
- std::iter::Filter::filter
- every
- std::iter::Iterator::all
- some
- std::iter::Iterator::any
- contains
- collections::vec::Vec::contains etc
- max
- core::slice::Items::max_by
- min
- core::slice::Items::min_by
- sortBy
- collections::vec::Vec::sort_by
- shuffle
- std::rand::Rng::shuffle
- sample
- std::rand::sample
- size
- std::collections::Collection::len
- keys
- collections::btree::map::BTreeMap::keys
- values
- collections::BTreeMap::values
- has
- collections::BTreeMap::contains_key
underscore-rust appends below functions.
- pairs
- invert
- pick
- omit
- defaults
- first
- without
- intersection
- uniq
- indexOf
- lastIndexOf