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>,
impl<T, TA> JsonSchema for Schema<T, TA>where
T: ?Sized,
TA: JsonSchemaAs<T>,
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: ?Sized, TA> RefUnwindSafe for Schema<T, TA>where
T: RefUnwindSafe,
TA: RefUnwindSafe,
impl<T: ?Sized, TA> Send for Schema<T, TA>
impl<T: ?Sized, TA> Sync for Schema<T, TA>
impl<T: ?Sized, TA> Unpin for Schema<T, TA>
impl<T: ?Sized, TA> UnwindSafe for Schema<T, TA>where
T: UnwindSafe,
TA: UnwindSafe,
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