GeezerVison is showing docs.rs — CodeObject in rustpython_vm::bytecode - Rust pub struct CodeObject<C = ConstantData>{Show 16 fields
pub instructions: Box<[CodeUnit]>,
pub locations: Box<[SourceLocation]>,
pub flags: CodeFlags,
pub posonlyarg_count: u32,
pub arg_count: u32,
pub kwonlyarg_count: u32,
pub source_path: <C as Constant>::Name,
pub first_line_number: Option<OneIndexed>,
pub max_stackdepth: u32,
pub obj_name: <C as Constant>::Name,
pub cell2arg: Option<Box<[i32]>>,
pub constants: Box<[C]>,
pub names: Box<[<C as Constant>::Name]>,
pub varnames: Box<[<C as Constant>::Name]>,
pub cellvars: Box<[<C as Constant>::Name]>,
pub freevars: Box<[<C as Constant>::Name]>,
}
Expand descriptionPrimary container of a single code object. Each python function has
a code object. Also a module has a code object.
Fields§§instructions: Box<[CodeUnit]>§locations: Box<[SourceLocation]>§flags: CodeFlags§posonlyarg_count: u32§arg_count: u32§kwonlyarg_count: u32§source_path: <C as Constant>::Name§first_line_number: Option<OneIndexed>§max_stackdepth: u32§obj_name: <C as Constant>::Name§cell2arg: Option<Box<[i32]>>§constants: Box<[C]>§names: Box<[<C as Constant>::Name]>§varnames: Box<[<C as Constant>::Name]>§cellvars: Box<[<C as Constant>::Name]>§freevars: Box<[<C as Constant>::Name]>Implementations§
Get all arguments of the code object
like inspect.getargs
Return the labels targeted by the instructions of this CodeObject
Recursively display this CodeObject
Map this CodeObject to one that holds a Bag::Constant
Same as map_bag but clones self
Trait Implementations§
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Auto Trait Implementations§Blanket Implementations§
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬This is a nightly-only experimental API. (clone_to_uninit) Performs copy-assignment from self to dest. Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
Returns the String produced by Ts Debug implementation.
§Examples
use malachite_base::strings::ToDebugString;
assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
[vec![2, 3], vec![], vec![4]].to_debug_string(),
"[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
|