pub struct Structural<T>(pub T);
Expand description
Utility wrapper to force values through structural serialization.
By default tokio-unix-ipc
will use
bincode
to serialize data across
process boundaries. This has some limitations which can cause
serialization or deserialization to fail for some types.
Since the serde ecosystem has some types which require structural serialization (eg: msgpack, JSON etc.) this type can be used to work around some known bugs:
- serde flatten not being supported: bincode#245
- vectors with unknown length not supported: bincode#167
This requires the serde-structural
feature.
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<T: Debug> Debug for Structural<T>
impl<T: Debug> Debug for Structural<T>
Source§impl<'de, T: DeserializeOwned> Deserialize<'de> for Structural<T>
impl<'de, T: DeserializeOwned> Deserialize<'de> for Structural<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Structural<T>, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Structural<T>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Ord> Ord for Structural<T>
impl<T: Ord> Ord for Structural<T>
Source§fn cmp(&self, other: &Structural<T>) -> Ordering
fn cmp(&self, other: &Structural<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for Structural<T>
impl<T: PartialEq> PartialEq for Structural<T>
Source§impl<T: PartialOrd> PartialOrd for Structural<T>
impl<T: PartialOrd> PartialOrd for Structural<T>
Source§impl<T: Serialize> Serialize for Structural<T>
impl<T: Serialize> Serialize for Structural<T>
impl<T: Eq> Eq for Structural<T>
impl<T> StructuralPartialEq for Structural<T>
Auto Trait Implementations§
impl<T> Freeze for Structural<T>where
T: Freeze,
impl<T> RefUnwindSafe for Structural<T>where
T: RefUnwindSafe,
impl<T> Send for Structural<T>where
T: Send,
impl<T> Sync for Structural<T>where
T: Sync,
impl<T> Unpin for Structural<T>where
T: Unpin,
impl<T> UnwindSafe for Structural<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