#ergo #std #standard #items #part #ecosystem

ergo_std

items that could be in the standard library, part of the ergo ecosystem

3 releases

Uses old Rust 2015

0.0.3 Apr 21, 2018
0.0.2 Apr 21, 2018
0.0.1 Feb 5, 2018

#13 in #ergo


Used in 2 crates (via ergo)

MIT/Apache

7KB

ergo_std: items that could be in the standard library.

Build Status Build status Docs

See the library docs for more information

LICENSE

The source code in this repository is Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

ergo_std: items that could be in the standard library.

This is the "core types" library as part of the ergo crates ecosystem. It contains useful types, traits and functions for general purpose programming projects which do not fall into the other ergo crates but which are boons to ergonomics and productivity.

How to Use

In your Cargo.toml

[dependencies]
ergo_std = "0.1"
serde = "1.0"
serde_derive = "1.0"

You have to put the other crates in your Cargo.toml in order for #[derive(...)] to work correctly.

#[macro_use] extern crate ergo_std;
use ergo_std::*;
fn main() {
    /* Your code goes here */
}

Exported Items

The following crates and types are exported. See their docs for how to use them.

  • std_prelude: extends rust's std::prelude with commonly used types. The crate is well documented with justification and usecases for each type.
  • serde: the defacto serialization library of rust. Also imports serde_derive so you can use #[derive(Serialize, Deserialize)].
  • lazy_static!: the lazy_static! macro is the current standard way to create global variables and constants. Warning that they are created lazily (at run time)!
  • itertools: the itertools prelude provides traits that extends rust's already extensive iterator API.
  • indexmap: indexable and sortable map and set types with similar performance to std types and beter performance when iterating.
  • maplit: provides hashmap!, hashset!, btreemap! and btreeset! macros to compliment rust's existing vec! macro. These
  • Regex: the regular expression type from the regex crate.

Special thanks

The crates that are exported are:

  • serde: Serialization framework for Rust
  • std_prelude: prelude that the rust stdlib should have always had
  • lazy_static: A small macro for defining lazy evaluated static variables in Rust.
  • itertools: Extra iterator adaptors, iterator methods, free functions, and macros.
  • indexmap: A hash table with consistent order and fast iteration (previously named ordermap)
  • maplit: Rust container / collection literal macros for HashMap, HashSet, BTreeMap, BTreeSet.
  • regex: An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

Consider supporting their development individually and starring them on github.

Dependencies

~6MB
~119K SLoC