Crate cex_derive

Crate cex_derive 

Source
Expand description

This crate is the proc-macro implementation for cex crate.

§Features

  • Result!( OkType throws A,B,... ) which is equivalant to Result<OkType, enumx::Enum!(A,B,...)>

  • ret!() Ok Type or Result

  • throw!() Error Types listed in throws

  • #[ty_pat] match, which enables “using types as patterns in match arms”.

  • #[cex] let local_var: pattern = expression;, which enables all the mentioned features in the expression, e.g try blocks.

  • #[cex] on closures, which enables all the mentioned features in the closure.

  • #[cex] fn, which enables all the mentioned features in the function.

  • cex::Logger derive for enum.

See more details in cex crate’s documents.

Macros§

Result
Result!() macro
ResultEnvLog
ResultLog
Throws
This is for trait’s associated type that is an error. Don’t use it in cex function signature, use Result!().
ThrowsEnvLog
This is for trait’s associated type that is an error. Don’t use it in cex function signature, use Result!().
ThrowsLog
This is for trait’s associated type that is an error. Don’t use it in cex function signature, use Result!().

Attribute Macros§

cex
tag an fn with #[cex] to:
cex_env_log
tag an fn with #[cex_env_log] to:
cex_log
tag an fn with #[cex_log] to:

Derive Macros§

Logger
Implements cex::Logger for an enum.