Struct python_packaging::policy::PythonPackagingPolicy [−][src]
pub struct PythonPackagingPolicy { /* fields omitted */ }Defines how Python resources should be packaged.
Implementations
impl PythonPackagingPolicy[src]
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]
&mut self,
extension: &str,
variant: &str
)
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]
&mut self,
location: Option<ConcreteResourceLocation>
)
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]
&self,
target_triple: &str
) -> Option<&Vec<String>>
Obtain broken extensions for a target triple.
pub fn register_broken_extension(
&mut self,
target_triple: &str,
extension: &str
)[src]
&mut self,
target_triple: &str,
extension: &str
)
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]
&self,
resource: &PythonResource<'_>
) -> PythonResourceAddCollectionContext
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]
&self,
extensions_variants: impl Iterator<Item = &'a PythonExtensionModuleVariants>,
target_triple: &str
) -> Result<Vec<PythonExtensionModule>>
Resolve Python extension modules that are compliant with the policy.
Trait Implementations
impl Clone for PythonPackagingPolicy[src]
impl Clone for PythonPackagingPolicy[src]fn clone(&self) -> PythonPackagingPolicy[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Default for PythonPackagingPolicy[src]
impl Default for PythonPackagingPolicy[src]impl PartialEq<PythonPackagingPolicy> for PythonPackagingPolicy[src]
impl PartialEq<PythonPackagingPolicy> for PythonPackagingPolicy[src]fn eq(&self, other: &PythonPackagingPolicy) -> bool[src]
fn ne(&self, other: &PythonPackagingPolicy) -> bool[src]
Auto Trait Implementations
impl RefUnwindSafe for PythonPackagingPolicy
impl RefUnwindSafe for PythonPackagingPolicyimpl Send for PythonPackagingPolicy
impl Send for PythonPackagingPolicyimpl Sync for PythonPackagingPolicy
impl Sync for PythonPackagingPolicyimpl Unpin for PythonPackagingPolicy
impl Unpin for PythonPackagingPolicyimpl UnwindSafe for PythonPackagingPolicy
impl UnwindSafe for PythonPackagingPolicy