Skip to content

Commit d4c03f1

Browse files
committed
Reorganize access module and make it public
1 parent 8ebc5b2 commit d4c03f1

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/access.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
pub trait Readable {}
22
pub trait Writable {}
33

4-
pub struct Read;
5-
6-
impl Readable for Read {}
7-
8-
pub struct Write;
9-
impl Writable for Write {}
10-
114
pub struct ReadWrite;
125
impl Readable for ReadWrite {}
136
impl Writable for ReadWrite {}
7+
8+
pub struct ReadOnly;
9+
10+
impl Readable for ReadOnly {}
11+
12+
pub struct WriteOnly;
13+
impl Writable for WriteOnly {}

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
1010
#![no_std]
1111

12-
pub use crate::access::{ReadWrite, Readable, Writable};
12+
use access::{ReadOnly, ReadWrite, Readable, Writable, WriteOnly};
1313
use core::{
1414
marker::PhantomData,
1515
ops::{Index, IndexMut},
1616
ptr,
1717
slice::SliceIndex,
1818
};
1919

20-
mod access;
20+
/// Allows creating read-only and write-only `Volatile` values.
21+
pub mod access;
2122

2223
/// A wrapper type around a reference to a volatile variable.
2324
///

0 commit comments

Comments
 (0)