pub fn lookup_key_to_number<N>(key: &[u8]) -> client::error::Result<N> where N: As<u64> {
	if key.len() < 4 {
		return Err(client::error::ErrorKind::Backend("Invalid block key".into()).into());
	}
	Ok((key[0] as u64) << 24
		| (key[1] as u64) << 16
		| (key[2] as u64) << 8
		| (key[3] as u64)).map(As::sa)
}
/// Convert block lookup key into block number.
/// all block lookup keys start with the block number.
Convert block lookup key into block number.
all block lookup keys start with the block number.
Convert block lookup key into block number . all block lookup keys start with the block number .
pub fn lookup_key_to_number<N>(key: &[u8]) -> client::error::Result<N> where N: As<u64> {
	if key.len() < 4 {
		return Err(client::error::ErrorKind::Backend("Invalid block key".into()).into());
	}
	Ok((key[0] as u64) << 24
		| (key[1] as u64) << 16
		| (key[2] as u64) << 8
		| (key[3] as u64)).map(As::sa)
}
pub fn lookup_key_to_number < N > ( key : & [ u8 ] ) -> client :: error :: Result < N > where N : As < u64 > { if key . len ( ) < 4 { return Err ( client :: error :: ErrorKind :: Backend ( " " . into ( ) ) . into ( ) ) ; } Ok ( ( key [ 0 ] as u64 ) << 24 | ( key [ 1 ] as u64 ) << 16 | ( key [ 2 ] as u64 ) << 8 | ( key [ 3 ] as u64 ) ) . map ( As :: sa ) }
Convert block lookup key into block number.
Convert block lookup key into block number .
key
&[u8]
key
&[u8]