#anonymous #throw #exception #error #ad-hoc

macro cex_derive

Macros for checked exception simulation

10 releases (5 breaking)

0.5.2 Apr 4, 2021
0.5.1 Feb 18, 2021
0.5.0 Nov 2, 2020
0.4.0 Jun 28, 2020
0.1.0 Nov 21, 2018

#23 in #throw

Download history 17/week @ 2024-08-28 14/week @ 2024-09-04 18/week @ 2024-09-11 26/week @ 2024-09-18 48/week @ 2024-09-25 20/week @ 2024-10-02 17/week @ 2024-10-09 23/week @ 2024-10-16 14/week @ 2024-10-23 16/week @ 2024-10-30 14/week @ 2024-11-06 13/week @ 2024-11-13 18/week @ 2024-11-20 23/week @ 2024-11-27 26/week @ 2024-12-04 24/week @ 2024-12-11

94 downloads per month
Used in 5 crates (via cex)

MIT license

37KB
624 lines

The cex_derive crate provides the proc-macro implementation for the cex crate.

See cex crate's doc ../cex/README.md for more.

Licensed under MIT.


lib.rs:

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.

Dependencies

~2.5MB
~53K SLoC