pub struct Policy {
pub invalid: Action,
pub vocab: Action,
pub allow_undefined: bool,
}
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.
Fields§
§invalid: Action
How to expand invalid terms.
vocab: Action
How to expand valid terms that need a vocabulary mapping
(@vocab
keyword).
allow_undefined: bool
How to expand valid terms when there is no vocabulary mapping.
Trait Implementations§
impl Copy for Policy
impl Eq for Policy
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
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
fn equivalent(&self, key: &K) -> bool
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.