pub fn write_value<W: io::Write + io::Seek>(wr: &mut W, prefix: ValuePrefix, content: &[u8])
    -> Result<ValuePtr, HashStoreError>
{

    let mut buffer: Vec<u8> = bincode::serialize(&prefix, bincode::Infinite)?;
    debug_assert!(buffer.len() == mem::size_of::<ValuePrefix>());
    buffer.extend_from_slice(content);


    wr.write_all(&buffer)?;
    let new_pos = wr.seek(io::SeekFrom::Current(0))?
        - content.len() as u64;

    Ok(ptr_new(new_pos, content.len()))
}
// write a value and its prefix and return the ValuePtr to the new object
write a value and its prefix and return the ValuePtr to the new object
write a value and its prefix and return the ValuePtr to the new object
pub fn write_value<W: io::Write + io::Seek>(wr: &mut W, prefix: ValuePrefix, content: &[u8])
    -> Result<ValuePtr, HashStoreError>
{
    let mut buffer: Vec<u8> = bincode::serialize(&prefix, bincode::Infinite)?;
    debug_assert!(buffer.len() == mem::size_of::<ValuePrefix>());
    buffer.extend_from_slice(content);
    wr.write_all(&buffer)?;
    let new_pos = wr.seek(io::SeekFrom::Current(0))?
        - content.len() as u64;
    Ok(ptr_new(new_pos, content.len()))
}
pub fn write_value < W : io :: Write + io :: Seek > ( wr : & mut W , prefix : ValuePrefix , content : & [ u8 ] ) -> Result < ValuePtr , HashStoreError > { let mut buffer : Vec < u8 > = bincode :: serialize ( & prefix , bincode :: Infinite ) ? ; debug_assert ! ( buffer len ( ) mem size_of ValuePrefix ( ) ) ; buffer . extend_from_slice ( content ) ; wr . write_all ( & buffer ) ? ; let new_pos = wr . seek ( io :: SeekFrom :: Current ( 0 ) ) ? - content . len ( ) as u64 ; Ok ( ptr_new ( new_pos , content . len ( ) ) ) }
write a value and its prefix and return the ValuePtr to the new object
write a value and its prefix and return the ValuePtr to the new object
wr
&mut W
prefix
ValuePrefix
content
&[u8]
wr
&mut W
prefix
ValuePrefix
content
&[u8]