smol-bytes 0.1.7

High-performance, clone-efficient byte buffers optimized for small data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::string::String;

use super::*;

impl ::borsh::BorshSerialize for Utf8BytesMut {
  fn serialize<W: ::borsh::io::Write>(&self, writer: &mut W) -> ::borsh::io::Result<()> {
    self.as_str().serialize(writer)
  }
}

impl ::borsh::BorshDeserialize for Utf8BytesMut {
  fn deserialize_reader<R: ::borsh::io::Read>(reader: &mut R) -> ::borsh::io::Result<Self> {
    let s = String::deserialize_reader(reader)?;
    Ok(Self::from(s))
  }
}