pub fn new<T: AsRef<[u8]>>(buf: &T) -> Result<Self, SPVError> {
        if buf.as_ref().len() < 80 {
            return Err(SPVError::WrongLengthHeader);
        }
        let mut header = Self::default();
        header.as_mut().copy_from_slice(&buf.as_ref()[..80]);
        Ok(header)
    }
/// Try to instantiate a new RawHeader from some bytes. Errors if the bytearray is not 80
/// bytes or more.
Try to instantiate a new RawHeader from some bytes. Errors if the bytearray is not 80
bytes or more.
Try to instantiate a new RawHeader from some bytes . Errors if the bytearray is not 80 bytes or more .
pub fn new<T: AsRef<[u8]>>(buf: &T) -> Result<Self, SPVError> {
        if buf.as_ref().len() < 80 {
            return Err(SPVError::WrongLengthHeader);
        }
        let mut header = Self::default();
        header.as_mut().copy_from_slice(&buf.as_ref()[..80]);
        Ok(header)
    }
pub fn new < T : AsRef < [ u8 ] > > ( buf : & T ) -> Result < Self , SPVError > { if buf . as_ref ( ) . len ( ) < 80 { return Err ( SPVError :: WrongLengthHeader ) ; } let mut header = Self :: default ( ) ; header . as_mut ( ) . copy_from_slice ( & buf . as_ref ( ) [ .. 80 ] ) ; Ok ( header ) }
Try to instantiate a new RawHeader from some bytes.
Try to instantiate a new RawHeader from some bytes .
buf
&T
buf
&T