pub enum PythonImplementation {
CPython,
PyPy,
MicroPython,
GraalPy,
RustPython,
}Expand description
Python implementation label.
Variants§
Implementations§
Source§impl PythonImplementation
impl PythonImplementation
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Returns the normalized implementation label.
Examples found in repository?
examples/basic_usage.rs (line 14)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let version: PythonVersion = "Python 3.12.1".parse()?;
8 let identifier = PythonIdentifier::new("async_task")?;
9 let requirement = PipRequirement::new("requests>=2")?;
10 let node_id = PytestNodeId::new("tests/test_app.py::test_smoke")?;
11
12 assert!(version.is_python3());
13 assert_eq!(identifier.as_str(), "async_task");
14 assert_eq!(PythonImplementation::CPython.as_str(), "cpython");
15 assert_eq!(PythonPrimitiveValue::None.type_name(), "NoneType");
16 assert!(!requirement.is_editable());
17 assert!(node_id.has_scope_separator());
18 Ok(())
19}Trait Implementations§
Source§impl Clone for PythonImplementation
impl Clone for PythonImplementation
Source§fn clone(&self) -> PythonImplementation
fn clone(&self) -> PythonImplementation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PythonImplementation
impl Debug for PythonImplementation
Source§impl Display for PythonImplementation
impl Display for PythonImplementation
Source§impl FromStr for PythonImplementation
impl FromStr for PythonImplementation
Source§type Err = PythonVersionParseError
type Err = PythonVersionParseError
The associated error which can be returned from parsing.
Source§fn from_str(
input: &str,
) -> Result<PythonImplementation, <PythonImplementation as FromStr>::Err>
fn from_str( input: &str, ) -> Result<PythonImplementation, <PythonImplementation as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for PythonImplementation
impl Hash for PythonImplementation
Source§impl Ord for PythonImplementation
impl Ord for PythonImplementation
Source§fn cmp(&self, other: &PythonImplementation) -> Ordering
fn cmp(&self, other: &PythonImplementation) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PythonImplementation
impl PartialEq for PythonImplementation
Source§fn eq(&self, other: &PythonImplementation) -> bool
fn eq(&self, other: &PythonImplementation) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PythonImplementation
impl PartialOrd for PythonImplementation
impl Copy for PythonImplementation
impl Eq for PythonImplementation
impl StructuralPartialEq for PythonImplementation
Auto Trait Implementations§
impl Freeze for PythonImplementation
impl RefUnwindSafe for PythonImplementation
impl Send for PythonImplementation
impl Sync for PythonImplementation
impl Unpin for PythonImplementation
impl UnsafeUnpin for PythonImplementation
impl UnwindSafe for PythonImplementation
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