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

Method find

crates/vm/src/bytes_inner.rs:554–565  ·  view source on GitHub ↗
(
        &self,
        options: ByteInnerFindOptions,
        find: F,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

552
553 #[inline]
554 pub fn find<F>(
555 &self,
556 options: ByteInnerFindOptions,
557 find: F,
558 vm: &VirtualMachine,
559 ) -> PyResult<Option<usize>>
560 where
561 F: Fn(&[u8], &[u8]) -> Option<usize>,
562 {
563 let (needle, range) = options.get_value(self.elements.len(), vm)?;
564 Ok(self.elements.py_find(&needle, range, find))
565 }
566
567 pub fn maketrans(from: Self, to: Self, vm: &VirtualMachine) -> PyResult<Vec<u8>> {
568 if from.len() != to.len() {

Callers 4

prep_reraise_starFunction · 0.45
import_module_levelFunction · 0.45
is_internal_frameMethod · 0.45

Calls 3

py_findMethod · 0.80
get_valueMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected