File tree 2 files changed +290
-284
lines changed
2 files changed +290
-284
lines changed Original file line number Diff line number Diff line change
1
+
2
+ pub trait Access { }
3
+
1
4
/// Helper trait that is implemented by [`ReadWrite`] and [`ReadOnly`].
2
5
pub trait Readable { }
3
6
@@ -7,16 +10,20 @@ pub trait Writable {}
7
10
/// Zero-sized marker type for allowing both read and write access.
8
11
#[ derive( Debug , Copy , Clone ) ]
9
12
pub struct ReadWrite ;
13
+ impl Access for ReadWrite { }
10
14
impl Readable for ReadWrite { }
11
15
impl Writable for ReadWrite { }
12
16
13
17
/// Zero-sized marker type for allowing only read access.
14
18
#[ derive( Debug , Copy , Clone ) ]
15
19
pub struct ReadOnly ;
16
20
21
+ impl Access for ReadOnly { }
17
22
impl Readable for ReadOnly { }
18
23
19
24
/// Zero-sized marker type for allowing only write access.
20
25
#[ derive( Debug , Copy , Clone ) ]
21
26
pub struct WriteOnly ;
27
+
28
+ impl Access for WriteOnly { }
22
29
impl Writable for WriteOnly { }
You can’t perform that action at this time.
0 commit comments