MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / borrow_from_ptr

Method borrow_from_ptr

src/objects/object.rs:183–186  ·  view source on GitHub ↗
(ptr: &*mut ffi::PyObject)

Source from the content-addressed store, hash-verified

181 /// Undefined behavior if the pointer is NULL or invalid.
182 #[inline]
183 pub unsafe fn borrow_from_ptr(ptr: &*mut ffi::PyObject) -> &PyObject {
184 debug_assert!(!ptr.is_null());
185 mem::transmute(ptr)
186 }
187
188 /// Transmutes a slice of owned FFI pointers to `&[PyObject]`.
189 /// Undefined behavior if any pointer in the slice is NULL or invalid.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected