pub struct ResourceRef<'a> { /* private fields */ }Expand description
A borrowed document with a concrete interpretation under a JSON Schema specification.
Implementations§
Source§impl<'a> ResourceRef<'a>
impl<'a> ResourceRef<'a>
pub fn new(contents: &'a Value, draft: Draft) -> Self
pub fn contents(&self) -> &'a Value
pub fn draft(&self) -> Draft
Sourcepub fn from_contents(contents: &'a Value) -> Self
pub fn from_contents(contents: &'a Value) -> Self
Create a resource-ref with automatically detecting specification which applies to the contents.
Unknown $schema values are treated as Draft::Unknown.
pub fn id(&self) -> Option<&str>
Trait Implementations§
Source§impl<'a> Clone for ResourceRef<'a>
impl<'a> Clone for ResourceRef<'a>
Source§fn clone(&self) -> ResourceRef<'a>
fn clone(&self) -> ResourceRef<'a>
Returns a duplicate 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<'a> Debug for ResourceRef<'a>
impl<'a> Debug for ResourceRef<'a>
impl<'a> Copy for ResourceRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ResourceRef<'a>
impl<'a> RefUnwindSafe for ResourceRef<'a>
impl<'a> Send for ResourceRef<'a>
impl<'a> Sync for ResourceRef<'a>
impl<'a> Unpin for ResourceRef<'a>
impl<'a> UnwindSafe for ResourceRef<'a>
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