#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

#21 in #throw

Download history 19/week @ 2024-07-20 22/week @ 2024-07-27 24/week @ 2024-08-03 12/week @ 2024-08-10 13/week @ 2024-08-17 12/week @ 2024-08-24 19/week @ 2024-08-31 15/week @ 2024-09-07 14/week @ 2024-09-14 45/week @ 2024-09-21 37/week @ 2024-09-28 11/week @ 2024-10-05 25/week @ 2024-10-12 18/week @ 2024-10-19 12/week @ 2024-10-26 20/week @ 2024-11-02

76 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