[−][src]Struct rustpython_bytecode::bytecode::CodeObject
Primary container of a single code object. Each python function has a codeobject. Also a module has a codeobject.
Fields
instructions: Vec<Instruction>
label_map: HashMap<Label, usize>
Jump targets.
locations: Vec<Location>
flags: CodeFlags
arg_names: Vec<String>
varargs: Varargs
kwonlyarg_names: Vec<String>
varkeywords: Varargs
source_path: String
first_line_number: usize
obj_name: String
Methods
impl CodeObject
[src]
pub fn new(
flags: CodeFlags,
arg_names: Vec<String>,
varargs: Varargs,
kwonlyarg_names: Vec<String>,
varkeywords: Varargs,
source_path: String,
first_line_number: usize,
obj_name: String
) -> CodeObject
[src]
flags: CodeFlags,
arg_names: Vec<String>,
varargs: Varargs,
kwonlyarg_names: Vec<String>,
varkeywords: Varargs,
source_path: String,
first_line_number: usize,
obj_name: String
) -> CodeObject
pub fn from_bytes(data: &[u8]) -> Result<Self, Box<dyn Error>>
[src]
Load a code object from bytes
pub fn to_bytes(&self) -> Vec<u8>
[src]
Serialize this bytecode to bytes.
pub fn get_constants(&self) -> impl Iterator<Item = &Constant>
[src]
pub fn display_expand_codeobjects<'a>(&'a self) -> impl Display + 'a
[src]
Trait Implementations
impl Clone for CodeObject
[src]
fn clone(&self) -> CodeObject
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CodeObject
[src]
impl<'de> Deserialize<'de> for CodeObject
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for CodeObject
[src]
impl PartialEq<CodeObject> for CodeObject
[src]
fn eq(&self, other: &CodeObject) -> bool
[src]
fn ne(&self, other: &CodeObject) -> bool
[src]
impl Serialize for CodeObject
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for CodeObject
[src]
Auto Trait Implementations
impl RefUnwindSafe for CodeObject
impl Send for CodeObject
impl Sync for CodeObject
impl Unpin for CodeObject
impl UnwindSafe for CodeObject
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,