MCPcopy Index your code
hub / github.com/RustPython/RustPython / try_into_utf8

Method try_into_utf8

crates/vm/src/builtins/str.rs:1523–1526  ·  view source on GitHub ↗
(self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1521 }
1522
1523 pub fn try_into_utf8(self, vm: &VirtualMachine) -> PyResult<PyRef<PyUtf8Str>> {
1524 self.ensure_valid_utf8(vm)?;
1525 Ok(unsafe { mem::transmute::<Self, PyRef<PyUtf8Str>>(self) })
1526 }
1527}
1528
1529struct CharLenStr<'a>(&'a str, usize);

Callers 14

extract_addressMethod · 0.80
from_tupleMethod · 0.80
callMethod · 0.80
register_dialectFunction · 0.80
get_dialectFunction · 0.80
unregister_dialectFunction · 0.80
parse_path_argMethod · 0.80
parse_cadata_argMethod · 0.80
repr_utf8Method · 0.80
str_utf8Method · 0.80
__format__Method · 0.80
set___name__Method · 0.80

Calls 1

ensure_valid_utf8Method · 0.80

Tested by

no test coverage detected