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

Method as_bytes

crates/vm/src/builtins/str.rs:474–476  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

472 }
473
474 pub const fn as_bytes(&self) -> &[u8] {
475 self.data.as_wtf8().as_bytes()
476 }
477
478 pub fn to_str(&self) -> Option<&str> {
479 self.data.as_str()

Callers 15

try_intMethod · 0.45
repeatMethod · 0.45
_containsMethod · 0.45
_compute_hashMethod · 0.45
splitMethod · 0.45
stripMethod · 0.45
py_split_whitespaceMethod · 0.45
py_rsplit_whitespaceMethod · 0.45
from_bytesMethod · 0.45
endswithMethod · 0.45
startswithMethod · 0.45
py_newMethod · 0.45

Calls 2

as_wtf8Method · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected