pub enum TypeMapping {
Literal(Value),
Transparent {
arg: usize,
},
}Expand description
What a table entry says about a type it cannot walk.
Most entries are a literal schema, but a transparent newtype wrapper
(#[serde(transparent)] struct Json<T>(pub T)) has no wire shape of its
own — it is exactly its type argument, so no literal can describe it
without erasing whatever it wraps.
Variants§
Literal(Value)
A JSON Schema substituted wherever the type appears.
Transparent
The type’s wire shape is that of one of its generic arguments.
Implementations§
Source§impl TypeMapping
impl TypeMapping
Sourcepub fn as_literal(&self) -> Option<&Value>
pub fn as_literal(&self) -> Option<&Value>
The literal schema, when this entry is one.
Trait Implementations§
Source§impl Clone for TypeMapping
impl Clone for TypeMapping
Source§impl Debug for TypeMapping
impl Debug for TypeMapping
impl Eq for TypeMapping
Source§impl From<Value> for TypeMapping
impl From<Value> for TypeMapping
Source§impl PartialEq for TypeMapping
impl PartialEq for TypeMapping
impl StructuralPartialEq for TypeMapping
Auto Trait Implementations§
impl Freeze for TypeMapping
impl RefUnwindSafe for TypeMapping
impl Send for TypeMapping
impl Sync for TypeMapping
impl Unpin for TypeMapping
impl UnsafeUnpin for TypeMapping
impl UnwindSafe for TypeMapping
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