#[non_exhaustive]pub enum Draft {
Draft4,
Draft6,
Draft7,
Draft201909,
Draft202012,
}
Expand description
JSON Schema specification versions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Draft4
JSON Schema Draft 4
Draft6
JSON Schema Draft 6
Draft7
JSON Schema Draft 7
Draft201909
JSON Schema Draft 2019-09
Draft202012
JSON Schema Draft 2020-12
Implementations§
source§impl Draft
impl Draft
pub fn create_resource(self, contents: Value) -> Resource
pub fn create_resource_ref(self, contents: &Value) -> ResourceRef<'_>
sourcepub fn detect(self, contents: &Value) -> Result<Draft, Error>
pub fn detect(self, contents: &Value) -> Result<Draft, Error>
Detect what specification could be applied to the given contents.
§Errors
On unknown $schema
value it returns Error::UnknownSpecification
pub fn subresources_of<'a>( self, contents: &'a Value, ) -> Box<dyn Iterator<Item = &'a Value> + 'a>
sourcepub fn is_known_keyword(&self, keyword: &str) -> bool
pub fn is_known_keyword(&self, keyword: &str) -> bool
Identifies known JSON schema keywords per draft.
Trait Implementations§
source§impl Ord for Draft
impl Ord for Draft
source§impl PartialOrd for Draft
impl PartialOrd for Draft
impl Copy for Draft
impl Eq for Draft
impl StructuralPartialEq for Draft
Auto Trait Implementations§
impl Freeze for Draft
impl RefUnwindSafe for Draft
impl Send for Draft
impl Sync for Draft
impl Unpin for Draft
impl UnwindSafe for Draft
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
)