Struct pyo3::PyModule [] [src]

pub struct PyModule(_);

Represents a Python module object.

Methods

impl PyModule
[src]

[src]

Create a new module object with the __name__ attribute set to name.

[src]

Import the Python module with the specified name.

[src]

Return the dictionary object that implements module's namespace; this object is the same as the __dict__ attribute of the module object.

[src]

Gets the module name.

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

[src]

Gets the module filename.

May fail if the module does not have a __file__ attribute.

[src]

Calls a function in the module. This is equivalent to the Python expression: getattr(module, name)(*args, **kwargs)

[src]

Calls a function in the module. This is equivalent to the Python expression: getattr(module, name)()

[src]

Calls a function in the module. This is equivalent to the Python expression: getattr(module, name)(*args)

[src]

Gets a member from the module. This is equivalent to the Python expression: getattr(module, name)

[src]

Adds a member to the module.

This is a convenience function which can be used from the module's initialization function.

[src]

Adds a new extension type to the module.

This is a convenience function that initializes the class, sets new_type.__module__ to this module's name, and adds the type to this module.

Trait Implementations

impl<'a> From<&'a PyModule> for &'a PyObjectRef
[src]

[src]

Performs the conversion.

impl AsRef<PyObjectRef> for PyModule
[src]

[src]

Performs the conversion.

impl PyObjectWithToken for PyModule
[src]

[src]

impl ToPyPointer for PyModule
[src]

[src]

Gets the underlying FFI pointer, returns a borrowed pointer.

impl PartialEq for PyModule
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PyTypeInfo for PyModule
[src]

Type of objects to store in PyObject struct

Base class

NAME: &'static str = "PyModule"

Class name

SIZE: usize = ::std::mem::size_of::<::ffi::PyObject>()

Size of the rust PyObject structure (PyObject + rust structure)

OFFSET: isize = 0

Type instance offset inside PyObject structure

[src]

PyTypeObject instance for this type

[src]

Check if *mut ffi::PyObject is instance of this type

DESCRIPTION: &'static str = "\u{0}"

Class doc string

FLAGS: usize = 0

Type flags (ie PY_TYPE_FLAG_GC, PY_TYPE_FLAG_WEAKREF)

[src]

Check if *mut ffi::PyObject is exact instance of this type

impl PyTypeObject for PyModule
[src]

[src]

Initialize type object

[src]

Retrieves the type object for this Python object type.

[src]

Create PyRawObject which can be initialized with rust value

impl ToPyObject for PyModule
[src]

[src]

Converts self into a Python object.

impl ToBorrowedObject for PyModule
[src]

[src]

Converts self into a Python object and calls the specified closure on the native FFI pointer underlying the Python object. Read more

impl Debug for PyModule
[src]

[src]

Formats the value using the given formatter. Read more

impl Display for PyModule
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a> FromPyObject<'a> for &'a PyModule
[src]

[src]

Extracts Self from the source PyObject.

Auto Trait Implementations

impl Send for PyModule

impl Sync for PyModule