43
43
//!
44
44
//! # Changelog
45
45
//!
46
+ //! ## 0.1.4-pre
47
+ //!
48
+ //! * Optional feature `serde` allows serializing [Type], [Access], and [Accessor].
49
+ //!
46
50
//! ## 0.1.3
47
51
//!
48
52
//! * Add [Type] enum for matching the file type.
@@ -74,6 +78,7 @@ fn type_bits(mode: u32) -> u32 {
74
78
/// assert_eq!(unix_mode::Type::from(0o0100640), unix_mode::Type::File);
75
79
/// ```
76
80
#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
81
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
77
82
#[ non_exhaustive]
78
83
pub enum Type {
79
84
/// A plain file.
@@ -119,6 +124,7 @@ impl From<u32> for Type {
119
124
120
125
/// Enum for specifying the context / "who" accesses in [is_allowed]
121
126
#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
127
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
122
128
pub enum Accessor {
123
129
/// Access by anyone other than the user or group.
124
130
Other ,
@@ -130,6 +136,7 @@ pub enum Accessor {
130
136
131
137
/// Enum for specifying the type of access in [is_allowed]
132
138
#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
139
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
133
140
pub enum Access {
134
141
/// Permission to "execute", broadly.
135
142
///
0 commit comments