pub struct Resolver<'r> { /* private fields */ }Expand description
A reference resolver.
Resolves references against the base URI and looks up the result in the registry.
Implementations§
Source§impl<'r> Resolver<'r>
impl<'r> Resolver<'r>
pub fn base_uri(&self) -> Arc<Uri<String>>
Sourcepub fn lookup(&self, reference: &str) -> Result<Resolved<'r>, Error>
pub fn lookup(&self, reference: &str) -> Result<Resolved<'r>, Error>
Resolve a reference to the resource it points to.
§Errors
If the reference cannot be resolved or is invalid.
Sourcepub fn lookup_recursive_ref(&self) -> Result<Resolved<'r>, Error>
pub fn lookup_recursive_ref(&self) -> Result<Resolved<'r>, Error>
Resolve a recursive reference.
This method implements the recursive reference resolution algorithm as specified in JSON Schema Draft 2019-09.
It starts by resolving “#” and then follows the dynamic scope,
looking for resources with $recursiveAnchor: true.
§Errors
This method can return any error that Resolver::lookup can return.
Sourcepub fn in_subresource(
&self,
subresource: ResourceRef<'_>,
) -> Result<Self, Error>
pub fn in_subresource( &self, subresource: ResourceRef<'_>, ) -> Result<Self, Error>
Create a resolver for a subresource.
§Errors
Returns an error if the resource id cannot be resolved against the base URI of this resolver.
pub fn dynamic_scope(&self) -> List<Uri<String>>
Trait Implementations§
impl Eq for Resolver<'_>
Auto Trait Implementations§
impl<'r> Freeze for Resolver<'r>
impl<'r> !RefUnwindSafe for Resolver<'r>
impl<'r> Send for Resolver<'r>
impl<'r> Sync for Resolver<'r>
impl<'r> Unpin for Resolver<'r>
impl<'r> !UnwindSafe for Resolver<'r>
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.