Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/access.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

pub trait Access {}

/// Helper trait that is implemented by [`ReadWrite`] and [`ReadOnly`].
pub trait Readable {}

Expand All @@ -7,16 +10,20 @@ pub trait Writable {}
/// Zero-sized marker type for allowing both read and write access.
#[derive(Debug, Copy, Clone)]
pub struct ReadWrite;
impl Access for ReadWrite {}
impl Readable for ReadWrite {}
impl Writable for ReadWrite {}

/// Zero-sized marker type for allowing only read access.
#[derive(Debug, Copy, Clone)]
pub struct ReadOnly;

impl Access for ReadOnly {}
impl Readable for ReadOnly {}

/// Zero-sized marker type for allowing only write access.
#[derive(Debug, Copy, Clone)]
pub struct WriteOnly;

impl Access for WriteOnly {}
impl Writable for WriteOnly {}
Loading