/// Write an IncrementalMerkleWitness to a writer.
Write an IncrementalMerkleWitness to a writer.
Write an IncrementalMerkleWitness to a writer .
pub fn write<W: Write>(&self, mut writer: W) -> std::io::Result<()> {
        self.tree.write(writer.by_ref())?;
        writer.write_all(&u64_array_to_u8_vector(&[
            self.filled_subtree_roots.len() as u64
        ]))?;
        for subtree_root in &self.filled_subtree_roots {
            subtree_root.write(writer.by_ref())?;
        }
        writer.write_all(&u64_array_to_u8_vector(
            &[self.current_subtree_depth as u64],
        ))?;
        match &self.current_subtree {
            None => writer.write_all(&[0])?,
            Some(subtree) => {
                writer.write_all(&[1])?;
                subtree.write(writer.by_ref())?;
            }
        }
        Ok(())
    }
pub fn write < W : Write > ( & self , mut writer : W ) -> std :: io :: Result < ( ) > { self . tree . write ( writer . by_ref ( ) ) ? ; writer . write_all ( & u64_array_to_u8_vector ( & [ self . filled_subtree_roots . len ( ) as u64 ] ) ) ? ; for subtree_root in & self . filled_subtree_roots { subtree_root . write ( writer . by_ref ( ) ) ? ; } writer . write_all ( & u64_array_to_u8_vector ( & [ self . current_subtree_depth as u64 ] , ) ) ? ; match & self . current_subtree { None => writer . write_all ( & [ 0 ] ) ? , Some ( subtree ) => { writer . write_all ( & [ 1 ] ) ? ; subtree . write ( writer . by_ref ( ) ) ? ; } } Ok ( ( ) ) }
Write an IncrementalMerkleWitness to a writer.
Write an IncrementalMerkleWitness to a writer .
&self
writer
W