Enum schema_analysis::targets::json_typegen::Shape
source · #[non_exhaustive]
pub enum Shape {
}
Expand description
The type representing the inferred structure
A word of caution: Everything in this crate is “internal API”, but for this type in particular, since it is very central to how json_typegen works, be prepared that major breaking changes may need to be made to this in the future.
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.
Bottom
Bottom
represents the absence of any inference information
Any
Any
represents conflicting inference information that can not be
represented by any single shape
Optional(Box<Shape, Global>)
Optional(T)
represents that a value is nullable, or not always present
Null
Equivalent to Optional(Bottom)
, Null
represents optionality with no further information
Bool
StringT
Integer
Floating
VecT
Struct
Fields
§
fields: LinkedHashMap<String, Shape, RandomState>
Tuple(Vec<Shape, Global>, u64)
MapT
Opaque(String)
Trait Implementations§
source§impl PartialEq<Shape> for Shape
impl PartialEq<Shape> for Shape
impl StructuralPartialEq for Shape
Auto Trait Implementations§
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnwindSafe for Shape
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.