pub enum PyLiteral {
Int(i64),
Float(f64),
String(String),
Bool(bool),
None,
Bytes(Vec<u8>),
}Expand description
Python literal types
Variants§
Int(i64)
Integer literal: 42, 0x2A, 0o52, 0b101010
Float(f64)
Float literal: 3.14, 1.0e10
String(String)
String literal: “hello”, ‘world’, r“raw“, f“formatted“
Bool(bool)
Boolean literal: True, False
None
None literal
Bytes(Vec<u8>)
Bytes literal: b“data“
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PyLiteral
impl<'de> Deserialize<'de> for PyLiteral
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for PyLiteral
Auto Trait Implementations§
impl Freeze for PyLiteral
impl RefUnwindSafe for PyLiteral
impl Send for PyLiteral
impl Sync for PyLiteral
impl Unpin for PyLiteral
impl UnwindSafe for PyLiteral
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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