Write the stream id to a writer
(&self, mut writer: W)
| 137 | |
| 138 | /// Write the stream id to a writer |
| 139 | pub fn write<W: Write>(&self, mut writer: W) -> anyhow::Result<()> { |
| 140 | let mut buf = encode::u64_buffer(); |
| 141 | let v = encode::u64(STREAMID_CODEC, &mut buf); |
| 142 | writer.write_all(v)?; |
| 143 | let v = encode::u64(self.r#type.int_value(), &mut buf); |
| 144 | writer.write_all(v)?; |
| 145 | self.cid.write_bytes(&mut writer)?; |
| 146 | Ok(()) |
| 147 | } |
| 148 | |
| 149 | /// Convert the stream id to a vector |
| 150 | pub fn to_vec(&self) -> Vec<u8> { |