logo
pub trait Type: Send + Sync {
    type RawValueType;
    type RawElementValueType;

    const IS_REQUIRED: bool;

    fn name() -> Cow<'static, str>;
    fn schema_ref() -> MetaSchemaRef;
    fn as_raw_value(&self) -> Option<&Self::RawValueType>;
    fn raw_element_iter<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = &'a Self::RawElementValueType> + 'a>; fn register(registry: &mut Registry) { ... } fn is_empty(&self) -> bool { ... } fn is_none(&self) -> bool { ... } }
Expand description

Represents a OpenAPI type.

Required Associated Types

The raw type used for validator.

Usually it is Self, but the wrapper type is its internal type.

For example:

i32::RawValueType is i32 Option<i32>::RawValueType is i32.

The raw element type used for validator.

Required Associated Constants

If it is true, it means that this type is required.

Required Methods

Returns the name of this type

Get schema reference of this type.

Returns a reference to the raw value.

Returns an iterator for traversing the elements.

Provided Methods

Register this type to types registry.

Returns true if this value is empty.

If the object’s field has the skip_serializing_if_is_empty attribute, call this method to test that the value is empty.

Returns true if this value is none.

If the object’s field has the skip_serializing_if_is_none attribute, call this method to test that the value is none.

Implementations on Foreign Types

Implementors