Struct python_packaging::policy::PythonPackagingPolicy[][src]

pub struct PythonPackagingPolicy { /* fields omitted */ }

Defines how Python resources should be packaged.

Implementations

impl PythonPackagingPolicy[src]

pub fn extension_module_filter(&self) -> &ExtensionModuleFilter[src]

Obtain the active extension module filter for this instance.

pub fn set_extension_module_filter(&mut self, filter: ExtensionModuleFilter)[src]

Set the extension module filter to use.

pub fn preferred_extension_module_variants(&self) -> &HashMap<String, String>[src]

Obtain the preferred extension module variants for this policy.

The returned object is a mapping of extension name to its variant name.

pub fn set_preferred_extension_module_variant(
    &mut self,
    extension: &str,
    variant: &str
)
[src]

Denote the preferred variant for an extension module.

If set, the named variant will be chosen if it is present.

pub fn resources_location(&self) -> &ConcreteResourceLocation[src]

Obtain the primary location for added resources.

pub fn set_resources_location(&mut self, location: ConcreteResourceLocation)[src]

Set the primary location for added resources.

pub fn resources_location_fallback(&self) -> &Option<ConcreteResourceLocation>[src]

Obtain the fallback location for added resources.

pub fn set_resources_location_fallback(
    &mut self,
    location: Option<ConcreteResourceLocation>
)
[src]

Set the fallback location for added resources.

pub fn allow_files(&self) -> bool[src]

Whether to allow untyped File resources.

pub fn set_allow_files(&mut self, value: bool)[src]

Set whether to allow untyped File resources.

pub fn file_scanner_emit_files(&self) -> bool[src]

Whether file scanning should emit PythonResource::File variants.

pub fn set_file_scanner_emit_files(&mut self, value: bool)[src]

Set whether file scanning should emit PythonResource::File variants.

pub fn file_scanner_classify_files(&self) -> bool[src]

Whether file scanning should classify files into PythonResource::* variants.

pub fn set_file_scanner_classify_files(&mut self, value: bool)[src]

Set whether file scanning should classify files into PythonResource::* variants.

pub fn allow_in_memory_shared_library_loading(&self) -> bool[src]

Whether to allow in-memory shared library loading.

pub fn set_allow_in_memory_shared_library_loading(&mut self, value: bool)[src]

Set the value for whether to allow in-memory shared library loading.

pub fn include_distribution_sources(&self) -> bool[src]

Get setting for whether to include source modules from the distribution.

pub fn set_include_distribution_sources(&mut self, include: bool)[src]

Set whether we should include a Python distribution’s module source code.

pub fn include_distribution_resources(&self) -> bool[src]

Get setting for whether to include Python package resources from the distribution.

pub fn set_include_distribution_resources(&mut self, include: bool)[src]

Set whether to include package resources from the Python distribution.

pub fn include_non_distribution_sources(&self) -> bool[src]

Whether to include Python sources for modules not in the standard library.

pub fn set_include_non_distribution_sources(&mut self, include: bool)[src]

Set whether to include Python sources for modules not in the standard library.

pub fn include_test(&self) -> bool[src]

Get setting for whether to include test files.

pub fn set_include_test(&mut self, include: bool)[src]

Set whether we should include Python modules that define tests.

pub fn include_file_resources(&self) -> bool[src]

Get whether to classify File resources as include by default.

pub fn set_include_file_resources(&mut self, value: bool)[src]

Set whether to classify File resources as include by default.

pub fn include_classified_resources(&self) -> bool[src]

Get whether to classify non-File resources as include by default.

pub fn set_include_classified_resources(&mut self, value: bool)[src]

Set whether to classify non-File resources as include by default.

pub fn bytecode_optimize_level_zero(&self) -> bool[src]

Whether to write bytecode at optimization level 0.

pub fn set_bytecode_optimize_level_zero(&mut self, value: bool)[src]

Set whether to write bytecode at optimization level 0.

pub fn bytecode_optimize_level_one(&self) -> bool[src]

Whether to write bytecode at optimization level 1.

pub fn set_bytecode_optimize_level_one(&mut self, value: bool)[src]

Set whether to write bytecode at optimization level 1.

pub fn bytecode_optimize_level_two(&self) -> bool[src]

Whether to write bytecode at optimization level 2.

pub fn set_bytecode_optimize_level_two(&mut self, value: bool)[src]

Set whether to write bytecode at optimization level 2.

pub fn set_resource_handling_mode(&mut self, mode: ResourceHandlingMode)[src]

Set the resource handling mode of the policy.

This is a convenience function for mapping a ResourceHandlingMode to corresponding field values.

pub fn broken_extensions_for_triple(
    &self,
    target_triple: &str
) -> Option<&Vec<String>>
[src]

Obtain broken extensions for a target triple.

pub fn register_broken_extension(
    &mut self,
    target_triple: &str,
    extension: &str
)
[src]

Mark an extension as broken on a target platform, preventing it from being used.

pub fn derive_add_collection_context(
    &self,
    resource: &PythonResource<'_>
) -> PythonResourceAddCollectionContext
[src]

Derive a PythonResourceAddCollectionContext for a resource using current settings.

The returned object essentially says how the resource should be added to a PythonResourceCollector given this policy.

pub fn resolve_python_extension_modules<'a>(
    &self,
    extensions_variants: impl Iterator<Item = &'a PythonExtensionModuleVariants>,
    target_triple: &str
) -> Result<Vec<PythonExtensionModule>>
[src]

Resolve Python extension modules that are compliant with the policy.

Trait Implementations

impl Clone for PythonPackagingPolicy[src]

fn clone(&self) -> PythonPackagingPolicy[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for PythonPackagingPolicy[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for PythonPackagingPolicy[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl PartialEq<PythonPackagingPolicy> for PythonPackagingPolicy[src]

fn eq(&self, other: &PythonPackagingPolicy) -> bool[src]

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

fn ne(&self, other: &PythonPackagingPolicy) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for PythonPackagingPolicy[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.