pub enum PyValue {
Bool(bool),
Int(i32),
Float(f64),
Str(String),
List(Vec<PyValue>),
Dict(HashMap<String, PyValue>),
Var(String),
None,
}
Expand description
A primitive Python value or variable to be used in a keyword argument.
Variants§
Bool(bool)
A bool
.
Int(i32)
An int
.
Float(f64)
A float
.
Str(String)
A str
.
List(Vec<PyValue>)
A list[...]
.
Dict(HashMap<String, PyValue>)
A dict[str, ...]
.
Var(String)
An arbitrary variable name.
Note: This variant is not validated as a Python identifier.
None
Python’s None
value.
Implementations§
Trait Implementations§
Source§impl<T: Into<PyValue>> FromIterator<T> for PyValue
impl<T: Into<PyValue>> FromIterator<T> for PyValue
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
impl StructuralPartialEq for PyValue
Auto Trait Implementations§
impl Freeze for PyValue
impl RefUnwindSafe for PyValue
impl Send for PyValue
impl Sync for PyValue
impl Unpin for PyValue
impl UnwindSafe for PyValue
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