pub fn from(header_bytes: &[u8]) -> Result<PayloadInfo, DecoderError> {
        match header_bytes.first().cloned() {
            None => Err(DecoderError::RlpIsTooShort {
                expected: 1,
                got: 0,
            }),
            Some(0..=0x7f) => Ok(PayloadInfo::new(0, 1)),
            Some(l @ 0x80..=0xb7) => Ok(PayloadInfo::new(1, l as usize - 0x80)),
            Some(l @ 0xb8..=0xbf) => {
                let len_of_len = l as usize - 0xb7;
                calculate_payload_info(header_bytes, len_of_len)
            }
            Some(l @ 0xc0..=0xf7) => Ok(PayloadInfo::new(1, l as usize - 0xc0)),
            Some(l @ 0xf8..=0xff) => {
                let len_of_len = l as usize - 0xf7;
                calculate_payload_info(header_bytes, len_of_len)
            }
        }
    }
/// Create a new object from the given bytes RLP. The bytes
Create a new object from the given bytes RLP. The bytes
Create a new object from the given bytes RLP . The bytes
pub fn from(header_bytes: &[u8]) -> Result<PayloadInfo, DecoderError> {
        match header_bytes.first().cloned() {
            None => Err(DecoderError::RlpIsTooShort {
                expected: 1,
                got: 0,
            }),
            Some(0..=0x7f) => Ok(PayloadInfo::new(0, 1)),
            Some(l @ 0x80..=0xb7) => Ok(PayloadInfo::new(1, l as usize - 0x80)),
            Some(l @ 0xb8..=0xbf) => {
                let len_of_len = l as usize - 0xb7;
                calculate_payload_info(header_bytes, len_of_len)
            }
            Some(l @ 0xc0..=0xf7) => Ok(PayloadInfo::new(1, l as usize - 0xc0)),
            Some(l @ 0xf8..=0xff) => {
                let len_of_len = l as usize - 0xf7;
                calculate_payload_info(header_bytes, len_of_len)
            }
        }
    }
pub fn from ( header_bytes : & [ u8 ] ) -> Result < PayloadInfo , DecoderError > { match header_bytes . first ( ) . cloned ( ) { None => Err ( DecoderError :: RlpIsTooShort { expected : 1 , got : 0 , } ) , Some ( 0 ..= 0x7f ) => Ok ( PayloadInfo :: new ( 0 , 1 ) ) , Some ( l @ 0x80 ..= 0xb7 ) => Ok ( PayloadInfo :: new ( 1 , l as usize - 0x80 ) ) , Some ( l @ 0xb8 ..= 0xbf ) => { let len_of_len = l as usize - 0xb7 ; calculate_payload_info ( header_bytes , len_of_len ) } Some ( l @ 0xc0 ..= 0xf7 ) => Ok ( PayloadInfo :: new ( 1 , l as usize - 0xc0 ) ) , Some ( l @ 0xf8 ..= 0xff ) => { let len_of_len = l as usize - 0xf7 ; calculate_payload_info ( header_bytes , len_of_len ) } } }
Create a new object from the given bytes RLP.
Create a new object from the given bytes RLP .
header_bytes
&[u8]
header_bytes
&[u8]