MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / to_list

Method to_list

flow-rs/src/loader/python/port.rs:36–45  ·  view source on GitHub ↗
(&self, py: Python)

Source from the content-addressed store, hash-verified

34 T: Owned2PyObject + Clone + Default,
35{
36 fn to_list(&self, py: Python) -> PyResult<PyObject> {
37 use pyo3::types::PyList;
38 let objects: PyResult<Vec<_>> = self
39 .storage
40 .values()
41 .cloned()
42 .map(|x| x.into_object(py))
43 .collect();
44 Ok(PyList::new(py, objects?).to_object(py))
45 }
46
47 fn to_object(&self, py: Python) -> PyResult<PyObject> {
48 self.storage

Callers 1

to_objectMethod · 0.80

Calls 2

into_objectMethod · 0.80
to_objectMethod · 0.80

Tested by

no test coverage detected