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

Method query

crates/wasm/src/browser_module.rs:168–176  ·  view source on GitHub ↗
(&self, query: PyStrRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

166 impl Document {
167 #[pymethod]
168 fn query(&self, query: PyStrRef, vm: &VirtualMachine) -> PyResult {
169 let elem = self
170 .doc
171 .query_selector(query.expect_str())
172 .map_err(|err| convert::js_py_typeerror(vm, err))?
173 .map(|elem| Element { elem })
174 .to_pyobject(vm);
175 Ok(elem)
176 }
177 }
178
179 #[pyattr]

Callers

nothing calls this directly

Calls 4

js_py_typeerrorFunction · 0.85
expect_strMethod · 0.80
to_pyobjectMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected