pub struct PythonCodeObject {Show 18 fields
pub name: String,
pub qualname: String,
pub source_name: String,
pub first_line: u32,
pub last_line: u32,
pub co_argcount: u8,
pub co_posonlyargcount: u8,
pub co_kwonlyargcount: u8,
pub co_nlocals: u8,
pub co_stacksize: u8,
pub co_flags: u32,
pub co_code: Vec<PythonInstruction>,
pub co_consts: Vec<PythonObject>,
pub co_names: Vec<String>,
pub co_localsplusnames: Vec<String>,
pub co_localspluskinds: Vec<u8>,
pub co_linetable: Vec<u8>,
pub co_exceptiontable: Vec<u8>,
}Expand description
Python 代码对象,包含字节码指令、常量、变量等信息。
Fields§
§name: String代码对象的名称。
qualname: String代码对象的限定名称。
source_name: String源文件名。
first_line: u32代码对象的起始行号。
last_line: u32代码对象的结束行号。
co_argcount: u8参数数量。
co_posonlyargcount: u8仅限位置参数的数量。
co_kwonlyargcount: u8仅限关键字参数的数量。
co_nlocals: u8局部变量数量。
co_stacksize: u8所需的最大栈大小。
co_flags: u32代码对象标志位。
co_code: Vec<PythonInstruction>字节码指令。
co_consts: Vec<PythonObject>代码对象使用的常量。
co_names: Vec<String>代码对象使用的名称。
co_localsplusnames: Vec<String>局部变量和自由变量名称。
co_localspluskinds: Vec<u8>局部变量和自由变量类型。
co_linetable: Vec<u8>用于调试的行号信息。
co_exceptiontable: Vec<u8>异常处理表。
Trait Implementations§
Source§impl Clone for PythonCodeObject
impl Clone for PythonCodeObject
Source§fn clone(&self) -> PythonCodeObject
fn clone(&self) -> PythonCodeObject
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 PythonCodeObject
impl Debug for PythonCodeObject
Source§impl Default for PythonCodeObject
impl Default for PythonCodeObject
Source§fn default() -> PythonCodeObject
fn default() -> PythonCodeObject
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PythonCodeObject
impl<'de> Deserialize<'de> for PythonCodeObject
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 PythonCodeObject
impl PartialEq for PythonCodeObject
Source§impl Serialize for PythonCodeObject
impl Serialize for PythonCodeObject
impl StructuralPartialEq for PythonCodeObject
Auto Trait Implementations§
impl Freeze for PythonCodeObject
impl RefUnwindSafe for PythonCodeObject
impl Send for PythonCodeObject
impl Sync for PythonCodeObject
impl Unpin for PythonCodeObject
impl UnwindSafe for PythonCodeObject
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