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]
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]
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]
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]
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]
pub fn resources_location(&self) -> &ConcreteResourceLocation
[src]Obtain the primary location for added resources.
pub fn set_resources_location(&mut self, location: ConcreteResourceLocation)
[src]
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]
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]
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]
pub fn allow_files(&self) -> bool
[src]Whether to allow untyped File
resources.
pub fn set_allow_files(&mut self, value: bool)
[src]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
impl Clone for PythonPackagingPolicy
[src]fn clone(&self) -> 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]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for PythonPackagingPolicy
[src]
impl Debug for PythonPackagingPolicy
[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 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]
fn ne(&self, other: &PythonPackagingPolicy) -> bool
[src]This method tests for !=
.
impl StructuralPartialEq for PythonPackagingPolicy
[src]
Auto Trait Implementations
impl RefUnwindSafe for PythonPackagingPolicy
impl Send for PythonPackagingPolicy
impl Sync for PythonPackagingPolicy
impl Unpin for PythonPackagingPolicy
impl UnwindSafe for PythonPackagingPolicy
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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