pub enum Schema {
Failsafe,
Json,
Core,
Custom(CustomSchema),
}Expand description
YAML Schema types as defined in YAML 1.2 specification
Variants§
Failsafe
Failsafe schema - only strings, sequences, and mappings
Json
JSON schema - JSON-compatible types only
Core
Core schema - full YAML 1.2 type system
Custom(CustomSchema)
User-defined custom schema
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn allows_scalar_type(&self, scalar_type: ScalarType) -> bool
pub fn allows_scalar_type(&self, scalar_type: ScalarType) -> bool
Check if a scalar type is allowed in this schema
Sourcepub fn allowed_scalar_types(&self) -> Vec<ScalarType>
pub fn allowed_scalar_types(&self) -> Vec<ScalarType>
Get the allowed scalar types for this schema
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl !RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl !UnwindSafe for Schema
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