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§impl PartialOrd for TypeOfAttribute
impl PartialOrd for TypeOfAttribute
source§impl Serialize for TypeOfAttribute
impl Serialize for TypeOfAttribute
impl Eq for TypeOfAttribute
impl StructuralPartialEq for TypeOfAttribute
Auto Trait Implementations§
impl Freeze for TypeOfAttribute
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more