ndarray/
private.rs

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