Expand description

A collection of all the procedural macros used in this crate. This macros can be divided into two categories:

  • Derive macros: These macros are used to derive traits for the data structures in this crate. These macros are:

    • Default: Default implementation for creating a new instance of the data structure. This macro is used to implement the Default trait.
    • Display: Allows the data structure to be printed using the Display trait.
    • Drop: Allows the data structure to be safely dropped using the Drop trait.
    • Extend: Allows the data structure to be extended using the Extend trait.
    • FromIterator: Allows the data structure to be created from an iterator using the FromIterator trait.
    • Index: Allows the data structure to be indexed using the Index trait.
    • IntoIterator: Allows the data structure to be iterated using the IntoIterator trait.
    • NewMacro: Allows the data structure to be created a macro with the same features as the vec! macro.
    • All: Allows the data structure to derive all the above traits.
  • Attribute macros: These macros are used to add functionality to the data structures in this crate. These macros are:

Attribute Macros

This macro is used to check if the collection is expanded when it is full. This is used to ensure that the collection is expanded when it is full. This macro should be used in the implementation of the add method of the Collection trait if the collection also implements FixedSizeCollection.

Derive Macros

This macro encapsulates all the Derive macros for a Collection. Currently it derives the following traits:
This macro is used to derive the Default a standard implementation for all the data structures that implement the Collection trait. The default implementation of the data structure will use the new_default method of the Collection trait.
This macro is used to derive the Display trait for all the data structures that implement the Collection trait. The Display trait is implemented by iterating over the elements of the data structure using iter and printing them using the Display trait of the type of the elements.
This macro is used to derive the Drop trait for all the data structures that implement the Collection trait. The drop implementation will call the clear method of the collection. This will remove all the elements from the collection ensuring that the elements are also dropped.
This macro is used to derive the Extend trait for all the data structures that implement the Collection trait. The Extend trait is implemented by iteratively adding the elements of the iterator to the data structure using the add method of the Collection trait.
This macro is used to derive the FromIterator a standard implementation for all the data structures that implement the Collection trait. This macro will automatically take into account the size of the iterator and create a new instance of the data structure with the appropriate capacity. This is useful for collections that have a fixed size (that implement the FixedSizeCollection trait) as it will prevent the collection from having to resize itself multiple times.
This macro is used to derive the Index and IndexMut traits for all the data structures that implement the Collection trait. Both traits will use the get and get_mut methods of the collection to access the elements and will panic if the index is out of bounds.
This macro is used to derive the IntoIterator a standard implementation for all the data structures that implement the Collection trait. This macro will create a generic wrapper around the data structure and then use some of the Collection methods to iterate over the elements of the data structure.
Generates a new macro for the Collection that follows the same syntax as array expressions. The macro will be exported to the crate root and will be named the same as the collection but in snake case.