pub fn to_scalar(self) -> Result<ScalarWitness, VMError> {
        match self {
            Data::Opaque(data) => {
                let scalar = SliceReader::parse(&data, |r| r.read_scalar())?;
                Ok(ScalarWitness::Scalar(scalar))
            }
            Data::Scalar(scalar_witness) => Ok(*scalar_witness),
            _ => Err(VMError::TypeNotScalar),
        }
    }
/// Downcast the data item to an `ScalarWitness` type.
Downcast the data item to an `ScalarWitness` type.
Downcast the data item to an ` ScalarWitness ` type .
pub fn to_scalar(self) -> Result<ScalarWitness, VMError> {
        match self {
            Data::Opaque(data) => {
                let scalar = SliceReader::parse(&data, |r| r.read_scalar())?;
                Ok(ScalarWitness::Scalar(scalar))
            }
            Data::Scalar(scalar_witness) => Ok(*scalar_witness),
            _ => Err(VMError::TypeNotScalar),
        }
    }
pub fn to_scalar ( self ) -> Result < ScalarWitness , VMError > { match self { Data :: Opaque ( data ) => { let scalar = SliceReader :: parse ( & data , | r | r . read_scalar ( ) ) ? ; Ok ( ScalarWitness :: Scalar ( scalar ) ) } Data :: Scalar ( scalar_witness ) => Ok ( * scalar_witness ) , _ => Err ( VMError :: TypeNotScalar ) , } }
Downcast the data item to an `ScalarWitness` type.
Downcast the data item to an ` ScalarWitness ` type .
self
self