Skip to content

Commit 23caaa0

Browse files
committed
caution on pub types
Signed-off-by: oflatt <oflatt@gmail.com>
1 parent 83fafe8 commit 23caaa0

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

cedar-policy-validator/src/entity_manifest.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ use crate::{
4545
///
4646
/// `T` represents an optional type annotation on each
4747
/// node in the [`AccessTrie`].
48+
// CAUTION: this type is publicly exported in `cedar-policy`.
49+
// Don't make fields `pub`, don't make breaking changes, and use caution
50+
// when adding public methods.
4851
#[doc = include_str!("../../cedar-policy/experimental_warning.md")]
4952
#[serde_as]
5053
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -61,10 +64,16 @@ where
6164
/// A map of data fields to [`AccessTrie`]s.
6265
/// The keys to this map form the edges in the access trie,
6366
/// pointing to sub-tries.
67+
// CAUTION: this type is publicly exported in `cedar-policy`.
68+
// Don't make fields `pub`, don't make breaking changes, and use caution
69+
// when adding public methods.
6470
#[doc = include_str!("../../cedar-policy/experimental_warning.md")]
6571
pub type Fields<T> = HashMap<SmolStr, Box<AccessTrie<T>>>;
6672

6773
/// The root of a data path or [`RootAccessTrie`].
74+
// CAUTION: this type is publicly exported in `cedar-policy`.
75+
// Don't make fields `pub`, don't make breaking changes, and use caution
76+
// when adding public methods.
6877
#[doc = include_str!("../../cedar-policy/experimental_warning.md")]
6978
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
7079
pub enum EntityRoot {
@@ -92,6 +101,9 @@ impl Display for EntityRoot {
92101
///
93102
/// `T` represents an optional type annotation on each
94103
/// node in the [`AccessTrie`].
104+
// CAUTION: this type is publicly exported in `cedar-policy`.
105+
// Don't make fields `pub`, don't make breaking changes, and use caution
106+
// when adding public methods.
95107
#[doc = include_str!("../../cedar-policy/experimental_warning.md")]
96108
#[serde_as]
97109
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -110,6 +122,10 @@ where
110122
///
111123
/// `T` represents an optional type annotation on each
112124
/// node in the [`AccessTrie`].
125+
///
126+
// CAUTION: this type is publicly exported in `cedar-policy`.
127+
// Don't make fields `pub`, don't make breaking changes, and use caution
128+
// when adding public methods.
113129
#[doc = include_str!("../../cedar-policy/experimental_warning.md")]
114130
#[serde_as]
115131
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -200,6 +216,9 @@ impl Diagnostic for PartialRequestError {}
200216
/// An error generated by entity slicing.
201217
/// See [`FailedAnalysisError`] for details on the fragment
202218
/// of Cedar handled by entity slicing.
219+
// CAUTION: this type is publicly exported in `cedar-policy`.
220+
// Don't make fields `pub`, don't make breaking changes, and use caution
221+
// when adding public methods.
203222
#[derive(Debug, Error, Diagnostic)]
204223
#[non_exhaustive]
205224
pub enum EntityManifestError {

0 commit comments

Comments
 (0)