Enum PythonPrimitiveValue
pub enum PythonPrimitiveValue {
None,
Bool(bool),
Int(String),
Float(f64),
Complex {
real: f64,
imag: f64,
},
String(String),
Bytes(Vec<u8>),
Ellipsis,
}Expand description
Primitive Python-like values for metadata and validation helpers.
Variants§
Implementations§
§impl PythonPrimitiveValue
impl PythonPrimitiveValue
pub fn is_truthy_like(&self) -> bool
pub fn is_truthy_like(&self) -> bool
Returns whether the value is approximately truthy by common Python primitive rules.
pub const fn is_numeric(&self) -> bool
pub const fn is_numeric(&self) -> bool
Returns whether the value is numeric-like.
Trait Implementations§
§impl Clone for PythonPrimitiveValue
impl Clone for PythonPrimitiveValue
§fn clone(&self) -> PythonPrimitiveValue
fn clone(&self) -> PythonPrimitiveValue
Returns a duplicate 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 more§impl Debug for PythonPrimitiveValue
impl Debug for PythonPrimitiveValue
§impl PartialEq for PythonPrimitiveValue
impl PartialEq for PythonPrimitiveValue
impl StructuralPartialEq for PythonPrimitiveValue
Auto Trait Implementations§
impl Freeze for PythonPrimitiveValue
impl RefUnwindSafe for PythonPrimitiveValue
impl Send for PythonPrimitiveValue
impl Sync for PythonPrimitiveValue
impl Unpin for PythonPrimitiveValue
impl UnsafeUnpin for PythonPrimitiveValue
impl UnwindSafe for PythonPrimitiveValue
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