Struct cedar_policy_validator::TypeOfAttribute
source · pub struct TypeOfAttribute {
pub ty: SchemaType,
pub required: bool,
}
Expand description
Used to describe the type of a record or entity attribute. It contains a the
type of the attribute and whether the attribute is required. The type is
flattened for serialization, so, in JSON format, this appears as a regular
type with one extra property required
.
Note that we can’t add #[serde(deny_unknown_fields)] here because we are
using #[serde(tag = “type”)] in ty:SchemaType which is flattened here.
The way serde(flatten) is implemented means it may be possible to access
fields incorrectly if a struct contains two structs that are flattened
(<https://github.com/serde-rs/serde/issues/1547>
). This shouldn’t apply to
us as we’re using flatten only once
(<https://github.com/serde-rs/serde/issues/1600>
). This should be ok because
unknown fields for TypeOfAttribute should be passed to SchemaType where
they will be denied (<https://github.com/serde-rs/serde/issues/1600>
).
Fields§
§ty: SchemaType
§required: bool
Trait Implementations§
source§impl Clone for TypeOfAttribute
impl Clone for TypeOfAttribute
source§fn clone(&self) -> TypeOfAttribute
fn clone(&self) -> TypeOfAttribute
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TypeOfAttribute
impl Debug for TypeOfAttribute
source§impl<'de> Deserialize<'de> for TypeOfAttribute
impl<'de> Deserialize<'de> for TypeOfAttribute
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Ord for TypeOfAttribute
impl Ord for TypeOfAttribute
source§fn cmp(&self, other: &TypeOfAttribute) -> Ordering
fn cmp(&self, other: &TypeOfAttribute) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for TypeOfAttribute
impl PartialEq for TypeOfAttribute
source§fn eq(&self, other: &TypeOfAttribute) -> bool
fn eq(&self, other: &TypeOfAttribute) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TypeOfAttribute
impl PartialOrd for TypeOfAttribute
source§fn partial_cmp(&self, other: &TypeOfAttribute) -> Option<Ordering>
fn partial_cmp(&self, other: &TypeOfAttribute) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for TypeOfAttribute
impl Serialize for TypeOfAttribute
impl Eq for TypeOfAttribute
impl StructuralEq for TypeOfAttribute
impl StructuralPartialEq for TypeOfAttribute
Auto Trait Implementations§
impl RefUnwindSafe for TypeOfAttribute
impl Send for TypeOfAttribute
impl Sync for TypeOfAttribute
impl Unpin for TypeOfAttribute
impl UnwindSafe for TypeOfAttribute
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.