File: private.rs

package info (click to toggle)
rust-ref-cast 1.0.25-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 268 kB
  • sloc: makefile: 2
file content (19 lines) | stat: -rw-r--r-- 358 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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() {}