MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / write

Method write

core/src/stream_id.rs:139–147  ·  view source on GitHub ↗

Write the stream id to a writer

(&self, mut writer: W)

Source from the content-addressed store, hash-verified

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> {

Callers 1

to_vecMethod · 0.45

Calls 1

write_allMethod · 0.80

Tested by

no test coverage detected