Macro hashconsing::consign

source ·
macro_rules! consign {
    (
        $(#[$meta:meta])*
        let $name:ident = consign($capa:expr) for $typ:ty ;
    ) => { ... };
    (
        $(#[$meta:meta])*
        let $name:ident = consign($capa:expr, $hash_builder:expr) for $typ:ty ;
    ) => { ... };
}
Expand description

Creates a lazy static consign.

The consign is protected by a RwLock.

Arguments:

  • $(#[$meta:meta])* meta stuff, typically comments ;
  • $name:ident name of the consign ;
  • $capa:expr initial capacity when creating the consign ;
  • $hash_builder:expr optional hash builder, an implementation of std::hash::BuildHasher ;
  • $typ:typ, type being hashconsed (the underlying type, not the hashconsed one) ;