fn lightning_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error> {
        let mut decoder = io::Cursor::new(data.as_ref());
        let rv = Self::lightning_decode(&mut decoder)?;
        let consumed = decoder.position() as usize;

        // Fail if data are not consumed entirely.
        if consumed == data.as_ref().len() {
            Ok(rv)
        } else {
            Err(Error::DataNotEntirelyConsumed)?
        }
    }
/// Tries to deserialize byte array into the current type using
/// [`LightningDecode::lightning_decode`] function.
Tries to deserialize byte array into the current type using
[`LightningDecode::lightning_decode`] function.
Tries to deserialize byte array into the current type using [ ` LightningDecode :: lightning_decode ` ] function .
fn lightning_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error> {
        let mut decoder = io::Cursor::new(data.as_ref());
        let rv = Self::lightning_decode(&mut decoder)?;
        let consumed = decoder.position() as usize;
        // Fail if data are not consumed entirely.
        if consumed == data.as_ref().len() {
            Ok(rv)
        } else {
            Err(Error::DataNotEntirelyConsumed)?
        }
    }
fn lightning_deserialize ( data : impl AsRef < [ u8 ] > ) -> Result < Self , Error > { let mut decoder = io :: Cursor :: new ( data . as_ref ( ) ) ; let rv = Self :: lightning_decode ( & mut decoder ) ? ; let consumed = decoder . position ( ) as usize ; // Fail if data are not consumed entirely. if consumed == data . as_ref ( ) . len ( ) { Ok ( rv ) } else { Err ( Error :: DataNotEntirelyConsumed ) ? } }
Tries to deserialize byte array into the current type using
[`LightningDecode::lightning_decode`] function.
Tries to deserialize byte array into the current type using [ ` LightningDecode :: lightning_decode ` ] function .
data
impl AsRef<[u8]>
data
impl AsRef<[u8]>