pub fn from_bytes(bytes: &[u8]) -> Result<BlockId> {
        if bytes.len() != BLOCK_ID_SIZE {
            let msg = format!("block ID too small: {}", bytes.len());
            return Err(ErrorKind::ParseFailure(msg).into());
        }

        let mut id = [0u8; BLOCK_ID_SIZE];
        id.copy_from_slice(&bytes[0..BLOCK_ID_SIZE]);

        Ok(BlockId(id))
    }
/// Create a block ID from a serialized
Create a block ID from a serialized
Create a block ID from a serialized
pub fn from_bytes(bytes: &[u8]) -> Result<BlockId> {
        if bytes.len() != BLOCK_ID_SIZE {
            let msg = format!("block ID too small: {}", bytes.len());
            return Err(ErrorKind::ParseFailure(msg).into());
        }
        let mut id = [0u8; BLOCK_ID_SIZE];
        id.copy_from_slice(&bytes[0..BLOCK_ID_SIZE]);
        Ok(BlockId(id))
    }
pub fn from_bytes ( bytes : & [ u8 ] ) -> Result < BlockId > { if bytes . len ( ) != BLOCK_ID_SIZE { let msg = format ! ( " " bytes len ( ) ) ; return Err ( ErrorKind :: ParseFailure ( msg ) . into ( ) ) ; } let mut id = [ 0u8 ; BLOCK_ID_SIZE ] ; id . copy_from_slice ( & bytes [ 0 .. BLOCK_ID_SIZE ] ) ; Ok ( BlockId ( id ) ) }
Create a block ID from a serialized
Create a block ID from a serialized
bytes
&[u8]
bytes
&[u8]