Struct serde_with::Same
source · pub struct Same;
Expand description
Adapter to convert from serde_as
to the serde traits.
This is the counter-type to As
.
It can be used whenever a type implementing DeserializeAs
/SerializeAs
is required but the normal Deserialize
/Serialize
traits should be used.
Check As
for an example.
Trait Implementations§
source§impl<'de, T: Deserialize<'de>> DeserializeAs<'de, T> for Same
impl<'de, T: Deserialize<'de>> DeserializeAs<'de, T> for Same
source§fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
source§impl<T: JsonSchema> JsonSchemaAs<T> for Same
Available on crate feature schemars_0_8
only.
impl<T: JsonSchema> JsonSchemaAs<T> for Same
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> SerializeAs<T> for Same
impl<T> SerializeAs<T> for Same
source§fn serialize_as<S>(source: &T, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(source: &T, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
Auto Trait Implementations§
impl Freeze for Same
impl RefUnwindSafe for Same
impl Send for Same
impl Sync for Same
impl Unpin for Same
impl UnwindSafe for Same
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