pub fn deserialize_datagrams<T>(
datagrams: Vec<Vec<u8>>,
) -> Result<Vec<T>, Error>
Expand description
Deserializes multiple datagrams into a unified vector of messages.
This function processes a collection of datagrams (Vec<Vec<u8>>
), deserializing each one
into its respective vector of messages and aggregating all messages into a single vector.
§Type Parameters
T
- The type of message to deserialize, which must implementDeserialize
andDisplay
.
§Arguments
datagrams
- A vector of datagrams, where each datagram is represented as aVec<u8>
.
§Returns
A Result
containing a unified vector of deserialized commands (Vec<CommandT>
) on success,
or a io::Error
if any deserialization fails.
§Errors
Returns io::Error
if deserialization of any individual datagram fails.