20 lines
358 B
Rust
20 lines
358 B
Rust
use ref_cast::{ref_cast_custom, RefCast, RefCastCustom};
|
|
|
|
#[derive(RefCast, RefCastCustom)]
|
|
#[repr(transparent)]
|
|
pub struct Public {
|
|
private: Private,
|
|
}
|
|
|
|
struct Private;
|
|
|
|
impl Public {
|
|
#[ref_cast_custom]
|
|
fn ref_cast(private: &Private) -> &Public;
|
|
|
|
#[ref_cast_custom]
|
|
fn ref_cast_mut(private: &mut Private) -> &mut Public;
|
|
}
|
|
|
|
fn main() {}
|