pub fn from_bytes(data: &[u8]) -> Result<Self, CodeDeserializeError> {
        use lz4_flex::block::DecompressError;
        let raw_bincode = lz4_flex::decompress_size_prepended(data).map_err(|e| match e {
            DecompressError::OutputTooSmall { .. } | DecompressError::ExpectedAnotherByte => {
                CodeDeserializeError::Eof
            }
            _ => CodeDeserializeError::Other,
        })?;
        let data = bincode::deserialize(&raw_bincode).map_err(|e| match *e {
            bincode::ErrorKind::Io(e) if e.kind() == std::io::ErrorKind::UnexpectedEof => {
                CodeDeserializeError::Eof
            }
            _ => CodeDeserializeError::Other,
        })?;
        Ok(data)
    }
/// Load a code object from bytes
Load a code object from bytes
Load a code object from bytes
pub fn from_bytes(data: &[u8]) -> Result<Self, CodeDeserializeError> {
        use lz4_flex::block::DecompressError;
        let raw_bincode = lz4_flex::decompress_size_prepended(data).map_err(|e| match e {
            DecompressError::OutputTooSmall { .. } | DecompressError::ExpectedAnotherByte => {
                CodeDeserializeError::Eof
            }
            _ => CodeDeserializeError::Other,
        })?;
        let data = bincode::deserialize(&raw_bincode).map_err(|e| match *e {
            bincode::ErrorKind::Io(e) if e.kind() == std::io::ErrorKind::UnexpectedEof => {
                CodeDeserializeError::Eof
            }
            _ => CodeDeserializeError::Other,
        })?;
        Ok(data)
    }
pub fn from_bytes ( data : & [ u8 ] ) -> Result < Self , CodeDeserializeError > { use lz4_flex :: block :: DecompressError ; let raw_bincode = lz4_flex :: decompress_size_prepended ( data ) . map_err ( | e | match e { DecompressError :: OutputTooSmall { .. } | DecompressError :: ExpectedAnotherByte => { CodeDeserializeError :: Eof } _ => CodeDeserializeError :: Other , } ) ? ; let data = bincode :: deserialize ( & raw_bincode ) . map_err ( | e | match * e { bincode :: ErrorKind :: Io ( e ) if e . kind ( ) == std :: io :: ErrorKind :: UnexpectedEof => { CodeDeserializeError :: Eof } _ => CodeDeserializeError :: Other , } ) ? ; Ok ( data ) }
Load a code object from bytes
Load a code object from bytes
data
&[u8]