Skip to content

Commit

Permalink
Allow conjuring private::Internal (esp-rs#2118)
Browse files Browse the repository at this point in the history
* Allow conjuring private::Internal

* Hide reexport
  • Loading branch information
bugadani authored Sep 10, 2024
1 parent 7332f58 commit dafad9b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions esp-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,32 @@ impl crate::private::Sealed for Async {}
pub(crate) mod private {
pub trait Sealed {}

#[non_exhaustive]
#[doc(hidden)]
/// Magical incantation to gain access to internal APIs.
pub struct Internal;

impl Internal {
/// Obtain magical powers to access internal APIs.
///
/// # Safety
///
/// By calling this function, you accept that you are using an internal
/// API that is not guaranteed to be documented, stable, working
/// and may change at any time.
///
/// You declare that you have tried to look for other solutions, that
/// you have opened a feature request or an issue to discuss the
/// need for this function.
pub unsafe fn conjure() -> Self {
Self
}
}
}

#[doc(hidden)]
pub use private::Internal;

/// Marker trait for types that can be safely used in `#[ram(persistent)]`.
///
/// # Safety
Expand Down

0 comments on commit dafad9b

Please sign in to comment.