rstmt_core/macros/
seal.rs

1/*
2    Appellation: seal <module>
3    Contrib: FL03 <jo3mccain@icloud.com>
4*/
5//! The public parts of this private module are used to create traits
6//! that cannot be implemented outside of our own crate.  This way we
7//! can feel free to extend those traits without worrying about it
8//! being a breaking change for other implementations.
9
10/// If this type is pub but not publicly reachable, third parties
11/// can't name it and can't implement traits using it.
12#[allow(dead_code)]
13pub struct Seal;
14
15#[allow(unused_macros)]
16macro_rules! private {
17    () => {
18        /// This trait is private to implement; this method exists to make it
19        /// impossible to implement outside the crate.
20        #[doc(hidden)]
21        fn __private__(&self) -> $crate::macros::seal::Seal;
22    };
23}
24
25#[allow(unused_macros)]
26macro_rules! seal {
27    () => {
28        fn __private__(&self) -> $crate::macros::seal::Seal {
29            $crate::macros::seal::Seal
30        }
31    };
32}