Enum json_ld_expansion::Policy
source · pub enum Policy {
Relaxed,
Standard,
Strict,
Strictest,
}
Expand description
Key expansion policy.
The default behavior of the expansion algorithm is to drop keys that are not defined in the context unless:
- there is a vocabulary mapping (
@vocab
) defined in the context; or - the term contains a
:
character. In other words, a key that cannot be expanded into an IRI or a blank node identifier is dropped unless it contains a:
character.
Sometimes, it is preferable to keep undefined keys in the
expanded document, or to forbid them completely by raising an error.
You can define your preferred policy using one of this type variant
with the Options::policy
field.
Variants§
Relaxed
Relaxed policy.
Undefined keys are always kept in the expanded document
using the Id::Invalid
variant.
Standard
Standard policy.
Every key that cannot be expanded into an
IRI or a blank node identifier is dropped unless it contains a :
character.
Strict
Strict policy.
Every key that cannot be expanded into an IRI or a blank node identifier
will raise an error unless the term contains a :
character.
Strictest
Strictest policy.
Every key that cannot be expanded into an IRI or a blank node identifier will raise an error.
Implementations§
Trait Implementations§
source§impl PartialEq<Policy> for Policy
impl PartialEq<Policy> for Policy
impl Copy for Policy
impl Eq for Policy
impl StructuralEq for Policy
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.