Function deserialize_datagrams

Source
pub fn deserialize_datagrams<T>(
    datagrams: Vec<Vec<u8>>,
) -> Result<Vec<T>, Error>
where T: Deserialize + Debug + Display,
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 implement Deserialize and Display.

§Arguments

  • datagrams - A vector of datagrams, where each datagram is represented as a Vec<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.