pub struct Resource { /* private fields */ }
Expand description
A document with a concrete interpretation under a JSON Schema specification.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn from_contents(contents: Value) -> Result<Resource, Error>
pub fn from_contents(contents: Value) -> Result<Resource, Error>
Create a resource with automatically detecting specification which applies to the contents.
§Errors
On unknown $schema
value it returns Error::UnknownSpecification
Sourcepub fn as_ref(&self) -> ResourceRef<'_>
pub fn as_ref(&self) -> ResourceRef<'_>
Give a reference to the underlying contents together with draft.
Trait Implementations§
impl Eq for Resource
impl StructuralPartialEq for Resource
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)