MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / get_owned

Method get_owned

src/array.rs:1509–1517  ·  view source on GitHub ↗
(&self, index: Idx)

Source from the content-addressed store, hash-verified

1507 }
1508
1509 fn get_owned<Idx>(&self, index: Idx) -> Option<T>
1510 where
1511 T: Element,
1512 D: Dimension,
1513 Idx: NpyIndex<Dim = D>,
1514 {
1515 let element = unsafe { self.get(index) };
1516 element.map(|elem| elem.clone_ref(self.py()))
1517 }
1518
1519 fn to_dyn(&self) -> &Bound<'py, PyArray<T, IxDyn>> {
1520 unsafe { self.cast_unchecked() }

Callers 2

from_python_to_rustFunction · 0.80
convertFunction · 0.80

Calls 2

clone_refMethod · 0.80
getMethod · 0.45

Tested by 1

from_python_to_rustFunction · 0.64