pub enum PythonObject {
Str(String),
Int(i32),
Integer(i64),
Float(f64),
Bool(bool),
String(String),
List(Vec<PythonObject>),
Tuple(Vec<PythonObject>),
Bytes(Vec<u8>),
Code(PythonCodeObject),
None,
}Expand description
表示不同类型的 Python 对象。
Variants§
Str(String)
Python 字符串对象。
Int(i32)
Python 整数对象(32位)。
Integer(i64)
Python 整数对象(64位)。
Float(f64)
Python 浮点数对象。
Bool(bool)
Python 布尔对象。
String(String)
另一个 Python 字符串对象(与 Str 重复,但为了兼容性保留)。
List(Vec<PythonObject>)
Python 列表对象。
Tuple(Vec<PythonObject>)
Python 元组对象。
Bytes(Vec<u8>)
Python 字节数组对象。
Code(PythonCodeObject)
Python 代码对象。
None
表示 Python 的 None 对象。
Trait Implementations§
Source§impl Clone for PythonObject
impl Clone for PythonObject
Source§fn clone(&self) -> PythonObject
fn clone(&self) -> PythonObject
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 moreSource§impl Debug for PythonObject
impl Debug for PythonObject
Source§impl Default for PythonObject
impl Default for PythonObject
Source§fn default() -> PythonObject
fn default() -> PythonObject
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PythonObject
impl<'de> Deserialize<'de> for PythonObject
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
Source§impl PartialEq for PythonObject
impl PartialEq for PythonObject
Source§impl Serialize for PythonObject
impl Serialize for PythonObject
impl StructuralPartialEq for PythonObject
Auto Trait Implementations§
impl Freeze for PythonObject
impl RefUnwindSafe for PythonObject
impl Send for PythonObject
impl Sync for PythonObject
impl Unpin for PythonObject
impl UnwindSafe for PythonObject
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