pub struct ImportLibraryGenerator { /* private fields */ }
Expand description

Windows import library generator for Python

Generates python3.dll or pythonXY.dll import library directly from the embedded Python ABI definitions data for the specified compile target.

Example usage

// Generate `python3.dll.a` in "target/python3-dll-a"
ImportLibraryGenerator::new("x86_64", "gnu")
    .generate(Path::new("target/python3-dll-a"))
    .unwrap();

// Generate `python3.lib` in "target/python3-lib"
ImportLibraryGenerator::new("x86_64", "msvc")
    .generate(Path::new("target/python3-lib"))
    .unwrap();

// Generate `python39.dll.a` in "target/python3-dll-a"
ImportLibraryGenerator::new("x86_64", "gnu")
    .version(Some((3, 9)))
    .generate(Path::new("target/python3-dll-a"))
    .unwrap();

// Generate `python38.lib` in "target/python3-lib"
ImportLibraryGenerator::new("x86_64", "msvc")
    .version(Some((3, 8)))
    .generate(Path::new("target/python3-lib"))
    .unwrap();

Implementations

Creates a new import library generator for the specified compile target.

The compile target architecture name (as in CARGO_CFG_TARGET_ARCH) is passed in arch.

The compile target environment ABI name (as in CARGO_CFG_TARGET_ENV) is passed in env.

Sets major and minor version for the pythonXY.dll import library.

The version-agnostic python3.dll is generated by default.

Generates the Python DLL import library in out_dir.

The version-agnostic python3.dll import library is generated by default unless the version-specific pythonXY.dll import was requested via version().

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.