Struct python_packaging::resource_collection::PrePackagedResource [−][src]
Represents a Python resource entry before it is packaged.
Instances hold the same fields as Resource except fields holding
content are backed by a FileData instead of Vec<u8>, since
we want data resolution to be lazy. In addition, bytecode can either be
provided verbatim or via source.
Fields
name: Stringis_package: boolis_namespace_package: boolin_memory_source: Option<FileData>in_memory_bytecode: Option<PythonModuleBytecodeProvider>in_memory_bytecode_opt1: Option<PythonModuleBytecodeProvider>in_memory_bytecode_opt2: Option<PythonModuleBytecodeProvider>in_memory_resources: Option<BTreeMap<String, FileData>>in_memory_distribution_resources: Option<BTreeMap<String, FileData>>relative_path_module_source: Option<(String, FileData)>relative_path_bytecode: Option<(String, String, PythonModuleBytecodeProvider)>relative_path_bytecode_opt1: Option<(String, String, PythonModuleBytecodeProvider)>relative_path_bytecode_opt2: Option<(String, String, PythonModuleBytecodeProvider)>relative_path_package_resources: Option<BTreeMap<String, (PathBuf, FileData)>>relative_path_distribution_resources: Option<BTreeMap<String, (PathBuf, FileData)>>is_module: boolis_builtin_extension_module: boolis_frozen_module: boolis_extension_module: boolis_utf8_filename_data: boolfile_executable: boolfile_data_embedded: Option<FileData>file_data_utf8_relative_path: Option<(PathBuf, FileData)>Implementations
impl PrePackagedResource[src]
pub fn is_python_resource(&self) -> bool[src]
Whether this resource represents a Python resource.
pub fn to_resource<'a>(
&self,
compiler: &mut dyn PythonBytecodeCompiler
) -> Result<(Resource<'a, u8>, Vec<FileInstall>)>[src]
&self,
compiler: &mut dyn PythonBytecodeCompiler
) -> Result<(Resource<'a, u8>, Vec<FileInstall>)>
Convert the instance to a Resource.
This will compile bytecode from source code using the specified compiler. It will also emit a list of file installs that must be performed for all referenced resources to function as intended.
Trait Implementations
impl Clone for PrePackagedResource[src]
fn clone(&self) -> PrePackagedResource[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for PrePackagedResource[src]
impl Default for PrePackagedResource[src]
fn default() -> PrePackagedResource[src]
impl PartialEq<PrePackagedResource> for PrePackagedResource[src]
fn eq(&self, other: &PrePackagedResource) -> bool[src]
fn ne(&self, other: &PrePackagedResource) -> bool[src]
impl StructuralPartialEq for PrePackagedResource[src]
Auto Trait Implementations
impl RefUnwindSafe for PrePackagedResource
impl Send for PrePackagedResource
impl Sync for PrePackagedResource
impl Unpin for PrePackagedResource
impl UnwindSafe for PrePackagedResource
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,