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
sourceimpl<'de, T: Deserialize<'de>> DeserializeAs<'de, T> for Same
impl<'de, T: Deserialize<'de>> DeserializeAs<'de, T> for Same
sourcefn 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.
sourceimpl<T> SerializeAs<T> for Same where
T: Serialize + ?Sized,
impl<T> SerializeAs<T> for Same where
T: Serialize + ?Sized,
sourcefn 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.
impl Copy for Same
Auto Trait Implementations
impl RefUnwindSafe for Same
impl Send for Same
impl Sync for Same
impl Unpin for Same
impl UnwindSafe for Same
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more