4343//!
4444//! # Changelog
4545//!
46+ //! ## 0.1.4-pre
47+ //!
48+ //! * Optional feature `serde` allows serializing [Type], [Access], and [Accessor].
49+ //!
4650//! ## 0.1.3
4751//!
4852//! * Add [Type] enum for matching the file type.
@@ -74,6 +78,7 @@ fn type_bits(mode: u32) -> u32 {
7478/// assert_eq!(unix_mode::Type::from(0o0100640), unix_mode::Type::File);
7579/// ```
7680#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
81+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
7782#[ non_exhaustive]
7883pub enum Type {
7984 /// A plain file.
@@ -119,6 +124,7 @@ impl From<u32> for Type {
119124
120125/// Enum for specifying the context / "who" accesses in [is_allowed]
121126#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
127+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
122128pub enum Accessor {
123129 /// Access by anyone other than the user or group.
124130 Other ,
@@ -130,6 +136,7 @@ pub enum Accessor {
130136
131137/// Enum for specifying the type of access in [is_allowed]
132138#[ derive( Debug , PartialEq , Eq , Clone , Copy ) ]
139+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
133140pub enum Access {
134141 /// Permission to "execute", broadly.
135142 ///
0 commit comments