ext_trait/lib.rs
1#![cfg_attr(feature = "better-docs",
2 cfg_attr(all(), doc = include_str!("../README.md")),
3)]
4#![no_std]
5#![forbid(unsafe_code)]
6
7/// See [the main docs][crate] for more info.
8///
9/// ## Advanced features
10///
11/// ### Extending the trait's privacy
12///
13/// This can be achieved by prepending a `pub` annotation before the
14/// `trait Name` argument:
15///
16/// ```rust ,no_run
17/// #[macro_use]
18/// extern crate ext_trait;
19///
20/// mod lib {
21/// // vvv
22/// #[extension(pub trait NoOp)]
23/// impl<T> T {
24/// fn no_op(self) -> Self { self }
25/// }
26/// }
27///
28/// fn main ()
29/// {
30/// use lib::NoOp;
31/// let x = 42.no_op().no_op().no_op().no_op().no_op().no_op();
32/// }
33/// ```
34
35pub use ::ext_trait_proc_macros::extension;
36
37// macro internals
38#[doc(hidden)] /** Not part of the public API */ pub
39mod __ {
40 pub use ::core;
41}
42
43#[cfg_attr(feature = "ui-tests",
44 cfg_attr(all(), doc = include_str!("compile_fail_tests.md")),
45)]
46mod _compile_fail_tests {}