[−][src]Struct python_packed_resources::data::Resource
Represents an embedded resource and all its metadata.
Fields
flavor: ResourceFlavor
The flavor of the resource.
name: Cow<'a, str>
The resource name.
is_package: bool
Whether the Python module is a package.
is_namespace_package: bool
Whether the Python module is a namespace package.
in_memory_source: Option<Cow<'a, [X]>>
Python module source code to use to import module from memory.
in_memory_bytecode: Option<Cow<'a, [X]>>
Python module bytecode to use to import module from memory.
in_memory_bytecode_opt1: Option<Cow<'a, [X]>>
Python module bytecode at optimized level 1 to use to import from memory.
in_memory_bytecode_opt2: Option<Cow<'a, [X]>>
Python module bytecode at optimized level 2 to use to import from memory.
Native machine code constituting a shared library for an extension module which can be imported from memory. (Not supported on all platforms.)
in_memory_package_resources: Option<HashMap<Cow<'a, str>, Cow<'a, [X]>>>
Mapping of virtual filename to data for resources to expose to Python's
importlib.resources
API via in-memory data access.
in_memory_distribution_resources: Option<HashMap<Cow<'a, str>, Cow<'a, [X]>>>
Mapping of virtual filename to data for package distribution metadata
to expose to Python's importlib.metadata
API via in-memory data access.
Native machine code constituting a shared library which can be imported from memory.
In-memory loading of shared libraries is not supported on all platforms.
Sequence of names of shared libraries this resource depends on.
relative_path_module_source: Option<Cow<'a, Path>>
Relative path to file containing Python module source code.
relative_path_module_bytecode: Option<Cow<'a, Path>>
Relative path to file containing Python module bytecode.
relative_path_module_bytecode_opt1: Option<Cow<'a, Path>>
Relative path to file containing Python module bytecode at optimization level 1.
relative_path_module_bytecode_opt2: Option<Cow<'a, Path>>
Relative path to file containing Python module bytecode at optimization level 2.
Relative path to file containing Python extension module loadable as a shared library.
relative_path_package_resources: Option<HashMap<Cow<'a, str>, Cow<'a, Path>>>
Mapping of Python package resource names to relative filesystem paths for those resources.
relative_path_distribution_resources: Option<HashMap<Cow<'a, str>, Cow<'a, Path>>>
Mapping of Python package distribution files to relative filesystem paths for those resources.
Methods
impl<'a, X: Clone + 'a> Resource<'a, X> where
[X]: ToOwned<Owned = Vec<X>>,
[src]
[X]: ToOwned<Owned = Vec<X>>,
pub fn is_meaningful(&self) -> bool
[src]
Whether the module is meaningful.
The module is meaningful if it has data attached or is a package.
pub fn index_v1_length(&self) -> usize
[src]
Compute length of index entry for version 1 payload format.
pub fn field_blob_length(&self, field: ResourceField) -> usize
[src]
Compute the length of a field.
Interior padding is not part of the returned length.
pub fn field_blob_interior_padding_length(
&self,
field: ResourceField,
padding: BlobInteriorPadding
) -> usize
[src]
&self,
field: ResourceField,
padding: BlobInteriorPadding
) -> usize
Compute the size of interior padding for a specific field.
pub fn write_index_v1<W: Write>(&self, dest: &mut W) -> Result<()>
[src]
Write the version 1 index entry for a module instance.
Trait Implementations
impl<'a, X: Clone + 'a> Clone for Resource<'a, X> where
[X]: ToOwned<Owned = Vec<X>>,
[src]
[X]: ToOwned<Owned = Vec<X>>,
impl<'a, X: Debug + 'a> Debug for Resource<'a, X> where
[X]: ToOwned<Owned = Vec<X>>,
[src]
[X]: ToOwned<Owned = Vec<X>>,
impl<'a, X> Default for Resource<'a, X> where
[X]: ToOwned<Owned = Vec<X>>,
[src]
[X]: ToOwned<Owned = Vec<X>>,
impl<'a, X: PartialEq + 'a> PartialEq<Resource<'a, X>> for Resource<'a, X> where
[X]: ToOwned<Owned = Vec<X>>,
[src]
[X]: ToOwned<Owned = Vec<X>>,
fn eq(&self, other: &Resource<'a, X>) -> bool
[src]
fn ne(&self, other: &Resource<'a, X>) -> bool
[src]
impl<'a, X: 'a> StructuralPartialEq for Resource<'a, X> where
[X]: ToOwned<Owned = Vec<X>>,
[src]
[X]: ToOwned<Owned = Vec<X>>,
Auto Trait Implementations
impl<'a, X> RefUnwindSafe for Resource<'a, X> where
X: RefUnwindSafe,
X: RefUnwindSafe,
impl<'a, X> Send for Resource<'a, X> where
X: Send + Sync,
X: Send + Sync,
impl<'a, X> Sync for Resource<'a, X> where
X: Sync,
X: Sync,
impl<'a, X> Unpin for Resource<'a, X> where
X: Unpin,
X: Unpin,
impl<'a, X> UnwindSafe for Resource<'a, X> where
X: RefUnwindSafe + UnwindSafe,
X: RefUnwindSafe + UnwindSafe,
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,