Struct fadroma::bin_serde::adapter::SerdeAdapter
source · pub struct SerdeAdapter<T: Serialize + DeserializeOwned>(pub T);
Expand description
A wrapper that allows serializing types that only implement CWs serialization traits. It simply uses CWs facilities to convert to JSON text bytes which Fadroma’s binary serialization understands.
By using this you are effectively bypassing Fadroma’s binary serialization benefits. As such, you probably don’t want to use it outside of testing…
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T: Clone + Serialize + DeserializeOwned> Clone for SerdeAdapter<T>
impl<T: Clone + Serialize + DeserializeOwned> Clone for SerdeAdapter<T>
source§fn clone(&self) -> SerdeAdapter<T>
fn clone(&self) -> SerdeAdapter<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug + Serialize + DeserializeOwned> Debug for SerdeAdapter<T>
impl<T: Debug + Serialize + DeserializeOwned> Debug for SerdeAdapter<T>
source§impl<T: Serialize + DeserializeOwned> FadromaDeserialize for SerdeAdapter<T>
impl<T: Serialize + DeserializeOwned> FadromaDeserialize for SerdeAdapter<T>
source§fn from_bytes<'a>(de: &mut Deserializer<'a>) -> Result<Self>
fn from_bytes<'a>(de: &mut Deserializer<'a>) -> Result<Self>
Deserialize into a new instance by reading bytes from
the provided
Deserializer
.source§impl<T: Serialize + DeserializeOwned> FadromaSerialize for SerdeAdapter<T>
impl<T: Serialize + DeserializeOwned> FadromaSerialize for SerdeAdapter<T>
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
The size in bytes of the particular instance when
converted to its byte respresentation. While it’s
preferred that this method returns an exact size
(or at least a bigger estimation) it’s not an error
to return an incorrect number. The penalty for doing
so is potentially incurring unnecessary re-allocations.
source§fn to_bytes(&self, ser: &mut Serializer) -> Result<()>
fn to_bytes(&self, ser: &mut Serializer) -> Result<()>
Serialize the instance into bytes by writing to
the provided
Serializer
.source§impl<T: Serialize + DeserializeOwned> From<T> for SerdeAdapter<T>
impl<T: Serialize + DeserializeOwned> From<T> for SerdeAdapter<T>
source§impl<T: PartialEq + Serialize + DeserializeOwned> PartialEq<SerdeAdapter<T>> for SerdeAdapter<T>
impl<T: PartialEq + Serialize + DeserializeOwned> PartialEq<SerdeAdapter<T>> for SerdeAdapter<T>
source§fn eq(&self, other: &SerdeAdapter<T>) -> bool
fn eq(&self, other: &SerdeAdapter<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Serialize + DeserializeOwned> StructuralPartialEq for SerdeAdapter<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for SerdeAdapter<T>where T: RefUnwindSafe,
impl<T> Send for SerdeAdapter<T>where T: Send,
impl<T> Sync for SerdeAdapter<T>where T: Sync,
impl<T> Unpin for SerdeAdapter<T>where T: Unpin,
impl<T> UnwindSafe for SerdeAdapter<T>where T: 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