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

Method name

src/objects/module.rs:75–77  ·  view source on GitHub ↗

Gets the module name. May fail if the module does not have a `__name__` attribute.

(&'a self, py: Python)

Source from the content-addressed store, hash-verified

73 ///
74 /// May fail if the module does not have a `__name__` attribute.
75 pub fn name<'a>(&'a self, py: Python) -> PyResult<&'a str> {
76 unsafe { self.str_from_ptr(py, ffi::PyModule_GetName(self.0.as_ptr())) }
77 }
78
79 /// Gets the module filename.
80 ///

Callers

nothing calls this directly

Calls 2

str_from_ptrMethod · 0.80
as_ptrMethod · 0.45

Tested by

no test coverage detected