pub fn data(&self) -> PyStringData {
        // TODO: return the original representation instead
        // of forcing the UTF-8 representation to be created.
        unsafe {
            let mut size: ffi::Py_ssize_t = mem::uninitialized();
            let data = ffi::PyUnicode_AsUTF8AndSize(self.0.as_ptr(), &mut size) as *const u8;
            if data.is_null() {
                PyErr::fetch(self.py()).print(self.py());
                panic!("PyUnicode_AsUTF8AndSize failed");
            }
            PyStringData::Utf8(std::slice::from_raw_parts(data, size as usize))
        }
    }
/// Gets the python string data in its underlying representation.
Gets the python string data in its underlying representation.
Gets the python string data in its underlying representation .
pub fn data(&self) -> PyStringData {
        // TODO: return the original representation instead
        // of forcing the UTF-8 representation to be created.
        unsafe {
            let mut size: ffi::Py_ssize_t = mem::uninitialized();
            let data = ffi::PyUnicode_AsUTF8AndSize(self.0.as_ptr(), &mut size) as *const u8;
            if data.is_null() {
                PyErr::fetch(self.py()).print(self.py());
                panic!("PyUnicode_AsUTF8AndSize failed");
            }
            PyStringData::Utf8(std::slice::from_raw_parts(data, size as usize))
        }
    }
pub fn data ( & self ) -> PyStringData { // TODO: return the original representation instead // of forcing the UTF-8 representation to be created. unsafe { let mut size : ffi :: Py_ssize_t = mem :: uninitialized ( ) ; let data = ffi :: PyUnicode_AsUTF8AndSize ( self . 0 . as_ptr ( ) , & mut size ) as * const u8 ; if data . is_null ( ) { PyErr :: fetch ( self . py ( ) ) . print ( self . py ( ) ) ; panic ! ( " " ) ; } PyStringData :: Utf8 ( std :: slice :: from_raw_parts ( data , size as usize ) ) } }
Gets the python string data in its underlying representation.
Gets the python string data in its underlying representation .
&self
&self