#[doc(hidden)]
#[macro_export]
macro_rules! priv_owned_str {
() => {
#[doc(hidden)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PrivOwnedStr(std::boxed::Box<std::primitive::str>);
impl std::fmt::Debug for PrivOwnedStr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
};
( $( $keyword:ident ),+ ) => {
$crate::priv_owned_str!();
$( $crate::priv_owned_str!(@keyword $keyword); )+
};
( @keyword uniffi ) => {
#[cfg(feature = "unstable-uniffi")]
#[derive(uniffi::Object)]
#[doc(hidden)]
pub struct PrivateString(std::boxed::Box<std::primitive::str>);
#[cfg(feature = "unstable-uniffi")]
uniffi::custom_type!(PrivOwnedStr, std::sync::Arc<PrivateString> , {
lower: |value| std::sync::Arc::new(PrivateString(value.0)),
try_lift: |value| Ok(PrivOwnedStr(value.0.clone())),
});
};
}