Crate macroland

Source
Expand description

§Macroland

Macroland is a Rust Crate, which provides macros for shorthand definitions of various types. Think how vec! is used to create empty, or filled up vectors. Macroland is full of various macros for this exact purpose.

Macros§

arc
arc! produces an Arc type! Enough said y’all!~~
arclock
arclock! Similar to the arctex! macro, this makes it simple to create an Arc<RwLock>!
arctex
arctex! Creates an Arc<Mutex>. Take a look at the example and see how quickly things get out of control! :O
binary_heap
binary_heap creates a Binary Heap. You can either create an empty variant, with its type explicity given, or a list of values.
boxed
boxed! provides a simple way to box a given type, without using ::new() each time you want to.
btreemap
btreemap! creates a BTreeMap. This can be done in two different ways.
btreeset
btreeset! creates a BTreeSet. Like HashSet, you can predefine its members, or the type of its future members.
cell
cell! Tired of calling new all the time? Here you go!
hashmap
hashmap! creates a HashMap. The OG is back, y’all… I’m kidding. I heard about there being a builtin hashmap! macro not too long ago, I guess I wasn’t around then. So, this one is for all those who remember.
hashset
hashset! creates a HashSet. You can either define its members during the macro call, or create an empty HashSet with its type predefined.
linkedlist
linkedlist! creates a LinkedList. Alike to the vecdeque! macro, all members are pushed to the front of the list, when predefined.
mutex
mutex! Wraps its input into a Mutex
oncecell
oncecell! Yup, here’s a OnceCell for you.
rc
rc! Reference Counting time!
refcell
refcell! new is so old school!
rwlock
rwlock! Time to lock and load Rustaceans!… I’m sorry.
vecdeque
vecdeque! creates a VecDeque. Be warned, members are pushed into the front of the VecDeque when predefining the members using this macro.