pub struct EntityManifest { /* private fields */ }
Available on crate feature
entity-manifest
only.Expand description
Data structure storing what data is needed
based on the the RequestType
.
For each request type, the EntityManifest
stores
a RootAccessTrie
of data to retrieve.
T
represents an optional type annotation on each
node in the AccessTrie
.
This feature is experimental. For more information see https://github.com/cedar-policy/rfcs/blob/main/README.md#experimental-features
Implementations§
Source§impl EntityManifest
impl EntityManifest
Sourcepub fn slice_entities(
&self,
entities: &Entities,
request: &Request,
) -> Result<Entities, EntitySliceError>
pub fn slice_entities( &self, entities: &Entities, request: &Request, ) -> Result<Entities, EntitySliceError>
Use this entity manifest to
find an entity slice using an existing Entities
store.
Source§impl EntityManifest
impl EntityManifest
Sourcepub fn per_action(&self) -> &HashMap<RequestType, RootAccessTrie>
pub fn per_action(&self) -> &HashMap<RequestType, RootAccessTrie>
Get the contents of the entity manifest indexed by the type of the request.
Sourcepub fn from_json_str(
json: &str,
schema: &ValidatorSchema,
) -> Result<EntityManifest, EntityManifestFromJsonError>
pub fn from_json_str( json: &str, schema: &ValidatorSchema, ) -> Result<EntityManifest, EntityManifestFromJsonError>
Convert a json string to an EntityManifest
.
Requires the schema in order to add type annotations.
Sourcepub fn from_json_value(
value: Value,
schema: &ValidatorSchema,
) -> Result<EntityManifest, EntityManifestFromJsonError>
pub fn from_json_value( value: Value, schema: &ValidatorSchema, ) -> Result<EntityManifest, EntityManifestFromJsonError>
Convert a json value to an EntityManifest
.
Requires the schema in order to add type annotations.
Trait Implementations§
Source§impl Clone for EntityManifest
impl Clone for EntityManifest
Source§fn clone(&self) -> EntityManifest
fn clone(&self) -> EntityManifest
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EntityManifest
impl Debug for EntityManifest
Source§impl<'de> Deserialize<'de> for EntityManifest
impl<'de> Deserialize<'de> for EntityManifest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EntityManifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EntityManifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EntityManifest
impl PartialEq for EntityManifest
Source§impl Serialize for EntityManifest
impl Serialize for EntityManifest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for EntityManifest
impl StructuralPartialEq for EntityManifest
Auto Trait Implementations§
impl Freeze for EntityManifest
impl RefUnwindSafe for EntityManifest
impl Send for EntityManifest
impl Sync for EntityManifest
impl Unpin for EntityManifest
impl UnwindSafe for EntityManifest
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
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>
Converts
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>
Converts
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