pub enum PythonResource<'a> {
ModuleSource(Cow<'a, PythonModuleSource>),
ModuleBytecodeRequest(Cow<'a, PythonModuleBytecodeFromSource>),
ModuleBytecode(Cow<'a, PythonModuleBytecode>),
PackageResource(Cow<'a, PythonPackageResource>),
PackageDistributionResource(Cow<'a, PythonPackageDistributionResource>),
ExtensionModule(Cow<'a, PythonExtensionModule>),
EggFile(Cow<'a, PythonEggFile>),
PathExtension(Cow<'a, PythonPathExtension>),
File(Cow<'a, File>),
}
Expand description
Represents a resource that can be read by Python somehow.
Variants§
ModuleSource(Cow<'a, PythonModuleSource>)
A module defined by source code.
ModuleBytecodeRequest(Cow<'a, PythonModuleBytecodeFromSource>)
A module defined by a request to generate bytecode from source.
ModuleBytecode(Cow<'a, PythonModuleBytecode>)
A module defined by existing bytecode.
PackageResource(Cow<'a, PythonPackageResource>)
A non-module resource file.
PackageDistributionResource(Cow<'a, PythonPackageDistributionResource>)
A file in a Python package distribution metadata collection.
ExtensionModule(Cow<'a, PythonExtensionModule>)
An extension module.
EggFile(Cow<'a, PythonEggFile>)
A self-contained Python egg.
PathExtension(Cow<'a, PythonPathExtension>)
A path extension.
File(Cow<'a, File>)
An arbitrary file and its data.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for PythonResource<'a>
impl<'a> Clone for PythonResource<'a>
Source§fn clone(&self) -> PythonResource<'a>
fn clone(&self) -> PythonResource<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for PythonResource<'a>
impl<'a> Debug for PythonResource<'a>
Source§impl<'a> From<&'a File> for PythonResource<'a>
impl<'a> From<&'a File> for PythonResource<'a>
Source§impl<'a> From<&'a PythonEggFile> for PythonResource<'a>
impl<'a> From<&'a PythonEggFile> for PythonResource<'a>
Source§fn from(e: &'a PythonEggFile) -> Self
fn from(e: &'a PythonEggFile) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PythonExtensionModule> for PythonResource<'a>
impl<'a> From<&'a PythonExtensionModule> for PythonResource<'a>
Source§fn from(r: &'a PythonExtensionModule) -> Self
fn from(r: &'a PythonExtensionModule) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PythonModuleBytecode> for PythonResource<'a>
impl<'a> From<&'a PythonModuleBytecode> for PythonResource<'a>
Source§fn from(m: &'a PythonModuleBytecode) -> Self
fn from(m: &'a PythonModuleBytecode) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PythonModuleBytecodeFromSource> for PythonResource<'a>
impl<'a> From<&'a PythonModuleBytecodeFromSource> for PythonResource<'a>
Source§fn from(m: &'a PythonModuleBytecodeFromSource) -> Self
fn from(m: &'a PythonModuleBytecodeFromSource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PythonModuleSource> for PythonResource<'a>
impl<'a> From<&'a PythonModuleSource> for PythonResource<'a>
Source§fn from(m: &'a PythonModuleSource) -> Self
fn from(m: &'a PythonModuleSource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PythonPackageDistributionResource> for PythonResource<'a>
impl<'a> From<&'a PythonPackageDistributionResource> for PythonResource<'a>
Source§fn from(r: &'a PythonPackageDistributionResource) -> Self
fn from(r: &'a PythonPackageDistributionResource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PythonPackageResource> for PythonResource<'a>
impl<'a> From<&'a PythonPackageResource> for PythonResource<'a>
Source§fn from(r: &'a PythonPackageResource) -> Self
fn from(r: &'a PythonPackageResource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a PythonPathExtension> for PythonResource<'a>
impl<'a> From<&'a PythonPathExtension> for PythonResource<'a>
Source§fn from(e: &'a PythonPathExtension) -> Self
fn from(e: &'a PythonPathExtension) -> Self
Converts to this type from the input type.
Source§impl<'a> From<File> for PythonResource<'a>
impl<'a> From<File> for PythonResource<'a>
Source§impl<'a> From<PythonEggFile> for PythonResource<'a>
impl<'a> From<PythonEggFile> for PythonResource<'a>
Source§fn from(e: PythonEggFile) -> Self
fn from(e: PythonEggFile) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PythonExtensionModule> for PythonResource<'a>
impl<'a> From<PythonExtensionModule> for PythonResource<'a>
Source§fn from(r: PythonExtensionModule) -> Self
fn from(r: PythonExtensionModule) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PythonModuleBytecode> for PythonResource<'a>
impl<'a> From<PythonModuleBytecode> for PythonResource<'a>
Source§fn from(m: PythonModuleBytecode) -> Self
fn from(m: PythonModuleBytecode) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PythonModuleBytecodeFromSource> for PythonResource<'a>
impl<'a> From<PythonModuleBytecodeFromSource> for PythonResource<'a>
Source§fn from(m: PythonModuleBytecodeFromSource) -> Self
fn from(m: PythonModuleBytecodeFromSource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PythonModuleSource> for PythonResource<'a>
impl<'a> From<PythonModuleSource> for PythonResource<'a>
Source§fn from(m: PythonModuleSource) -> Self
fn from(m: PythonModuleSource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PythonPackageDistributionResource> for PythonResource<'a>
impl<'a> From<PythonPackageDistributionResource> for PythonResource<'a>
Source§fn from(r: PythonPackageDistributionResource) -> Self
fn from(r: PythonPackageDistributionResource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PythonPackageResource> for PythonResource<'a>
impl<'a> From<PythonPackageResource> for PythonResource<'a>
Source§fn from(r: PythonPackageResource) -> Self
fn from(r: PythonPackageResource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PythonPathExtension> for PythonResource<'a>
impl<'a> From<PythonPathExtension> for PythonResource<'a>
Source§fn from(e: PythonPathExtension) -> Self
fn from(e: PythonPathExtension) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for PythonResource<'a>
impl<'a> PartialEq for PythonResource<'a>
impl<'a> StructuralPartialEq for PythonResource<'a>
Auto Trait Implementations§
impl<'a> Freeze for PythonResource<'a>
impl<'a> RefUnwindSafe for PythonResource<'a>
impl<'a> Send for PythonResource<'a>
impl<'a> Sync for PythonResource<'a>
impl<'a> Unpin for PythonResource<'a>
impl<'a> UnwindSafe for PythonResource<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more