Trait il2_iltags::tags::serialization::ByteArrayDeserializer[][src]

pub trait ByteArrayDeserializer {
    fn deserialize_bytes(&mut self, size: usize) -> Result<Vec<u8>>;
fn deserialize_bytes_into_slice(&mut self, buff: &mut [u8]) -> Result<()>; fn deserialize_bytes_into_vec(
        &mut self,
        size: usize,
        vec: &mut Vec<u8>
    ) -> Result<()> { ... } }
Expand description

This trait adds the ability to deserialize byte arrays.

Since 1.2.0.

Required methods

Deserializes a byte array of a given size.

Arguments:

  • size: The number of bytes to read;

Returns:

  • Ok(v): A vector with the bytes read;
  • Err(e): In case of error;

Deserializes a byte array of a given size into slice.

Arguments:

  • buff: The vector that will receive the data;

Returns:

  • Ok(v): A vector with the bytes read;
  • Err(e): In case of error;

Provided methods

Deserializes a byte array of a given size into a vector.

Arguments:

  • size: The number of bytes to read;
  • vec: The vector that will receive the data;

Returns:

  • Ok(v): A vector with the bytes read;
  • Err(e): In case of error;

Implementors