Struct serde_with::Schema
source · pub struct Schema<T: ?Sized, TA>(/* private fields */);
Expand description
Helper for implementing JsonSchema
on serializers whose output depends
on the type of the concrete field.
It is added implicitly by the #[serde_as]
macro when any schemars
feature is enabled.
Trait Implementations§
source§impl<T, TA> JsonSchema for Schema<T, TA>where
T: ?Sized,
TA: JsonSchemaAs<T>,
Available on crate feature schemars_0_8
only.
impl<T, TA> JsonSchema for Schema<T, TA>where
T: ?Sized,
TA: JsonSchemaAs<T>,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<T, TA> JsonSchema for Schema<Vec<T>, OneOrMany<TA, PreferOne>>where
Schema<T, TA>: JsonSchema,
Available on crate feature schemars_0_8
only.
impl<T, TA> JsonSchema for Schema<Vec<T>, OneOrMany<TA, PreferOne>>where
Schema<T, TA>: JsonSchema,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<T, TA> JsonSchema for Schema<Vec<T>, OneOrMany<TA, PreferMany>>where
Schema<T, TA>: JsonSchema,
Available on crate feature schemars_0_8
only.
impl<T, TA> JsonSchema for Schema<Vec<T>, OneOrMany<TA, PreferMany>>where
Schema<T, TA>: JsonSchema,
Available on crate feature
schemars_0_8
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreAuto Trait Implementations§
impl<T, TA> Freeze for Schema<T, TA>where
T: ?Sized,
impl<T, TA> RefUnwindSafe for Schema<T, TA>
impl<T, TA> Send for Schema<T, TA>
impl<T, TA> Sync for Schema<T, TA>
impl<T, TA> Unpin for Schema<T, TA>
impl<T, TA> UnwindSafe for Schema<T, TA>
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