Skip to content

mindsbackyard/facade_attr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Facade attribute

This is an experimental implementation of the inline keyword alternative as discussed on the Rust internals forum.

The custom attribute is intended to simplify the module facade pattern which is common to rust module structure. It reexports the pub items of the annotated module.

#[facade] mod sub_module;

It supports a pseudo hiding feature to make the annotated module unaddressable by its name. This is done by mangling the modules name with the time of compilation. The hiding might fail if by chance another item with the mangled name is already defined (or if the time of compilation can be predicted).

#[facade(hide)] mod sub_module;

Have a look in the tests folder to see some example usage. This attribute requires proc_macro_attribute and is currently only usable on the nightly channel of Rust.

About

A custom attribute to simplify the module facade pattern in Rust (nightly)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages