pub fn from_slice(bytes: &[u8]) -> Result<Self, Error> {
        let mut exp = 0;
        let mut mantissa = 0;
        let mut min_value = 0;
        let mut max_value = 0;

        let ret = unsafe {
            ffi::secp256k1_rangeproof_info(
                ffi::secp256k1_context_no_precomp,
                &mut exp,
                &mut mantissa,
                &mut min_value,
                &mut max_value,
                bytes.as_ptr(),
                bytes.len(),
            )
        };

        if ret == 0 {
            return Err(Error::InvalidRangeProof);
        }

        Ok(RangeProof {
            inner: ffi::RangeProof::new(bytes),
        })
    }
/// Parse from byte slice.
///
/// TODO: Rename to parse (and other similar functions)
Parse from byte slice.
TODO: Rename to parse (and other similar functions)
Parse from byte slice . TODO : Rename to parse ( and other similar functions )
pub fn from_slice(bytes: &[u8]) -> Result<Self, Error> {
        let mut exp = 0;
        let mut mantissa = 0;
        let mut min_value = 0;
        let mut max_value = 0;
        let ret = unsafe {
            ffi::secp256k1_rangeproof_info(
                ffi::secp256k1_context_no_precomp,
                &mut exp,
                &mut mantissa,
                &mut min_value,
                &mut max_value,
                bytes.as_ptr(),
                bytes.len(),
            )
        };
        if ret == 0 {
            return Err(Error::InvalidRangeProof);
        }
        Ok(RangeProof {
            inner: ffi::RangeProof::new(bytes),
        })
    }
pub fn from_slice ( bytes : & [ u8 ] ) -> Result < Self , Error > { let mut exp = 0 ; let mut mantissa = 0 ; let mut min_value = 0 ; let mut max_value = 0 ; let ret = unsafe { ffi :: secp256k1_rangeproof_info ( ffi :: secp256k1_context_no_precomp , & mut exp , & mut mantissa , & mut min_value , & mut max_value , bytes . as_ptr ( ) , bytes . len ( ) , ) } ; if ret == 0 { return Err ( Error :: InvalidRangeProof ) ; } Ok ( RangeProof { inner : ffi :: RangeProof :: new ( bytes ) , } ) }
Parse from byte slice.
Parse from byte slice .
bytes
&[u8]
bytes
&[u8]