MCPcopy Index your code
hub / github.com/dgrunwald/rust-cpython / data

Method data

src/objects/string.rs:270–272  ·  view source on GitHub ↗

Gets the python string data in its underlying representation. For Python 2 byte strings, this function always returns `PyStringData::Utf8`, even if the bytes are not valid UTF-8. For unicode strings, returns the underlying representation used by Python.

(&self, py: Python)

Source from the content-addressed store, hash-verified

268 /// even if the bytes are not valid UTF-8.
269 /// For unicode strings, returns the underlying representation used by Python.
270 pub fn data(&self, py: Python) -> PyStringData {
271 self.data_impl(py)
272 }
273
274 #[cfg(feature = "python27-sys")]
275 fn data_impl(&self, py: Python) -> PyStringData {

Callers 7

data_implMethod · 0.80
to_stringMethod · 0.80
to_string_lossyMethod · 0.80
extractMethod · 0.80
test_extract_umlautFunction · 0.80
deserialize_bytesMethod · 0.80

Calls 4

PyUnicode_AS_UNICODEFunction · 0.85
PyUnicode_GET_SIZEFunction · 0.85
data_implMethod · 0.80
as_ptrMethod · 0.45

Tested by 2

test_extract_umlautFunction · 0.64