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

Method get_value

crates/vm/src/bytes_inner.rs:150–161  ·  view source on GitHub ↗
(
        self,
        len: usize,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

148
149impl ByteInnerFindOptions {
150 pub fn get_value(
151 self,
152 len: usize,
153 vm: &VirtualMachine,
154 ) -> PyResult<(Vec<u8>, core::ops::Range<usize>)> {
155 let sub = match self.sub {
156 Either::A(v) => v.elements.to_vec(),
157 Either::B(int) => vec![int.as_bigint().byte_or(vm)?],
158 };
159 let range = anystr::adjust_indices(self.start, self.end, len);
160 Ok((sub, range))
161 }
162}
163
164#[derive(FromArgs)]

Callers 4

_padMethod · 0.45
countMethod · 0.45
findMethod · 0.45
translateMethod · 0.45

Calls 11

adjust_indicesFunction · 0.85
try_as_bytesFunction · 0.85
to_vecMethod · 0.80
ok_or_elseMethod · 0.80
okMethod · 0.80
try_into_valueMethod · 0.80
flattenMethod · 0.45
cloneMethod · 0.45
iterMethod · 0.45
filterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected