Trait cpclib_asm::implementation::listing::ListingExt
source · pub trait ListingExt {
// Required methods
fn add_code<S: AsRef<str> + Display>(
&mut self,
code: S
) -> Result<(), AssemblerError>;
fn to_bytes_with_options(
&self,
option: EnvOptions
) -> Result<Vec<u8>, AssemblerError>;
fn estimated_duration(&self) -> Result<usize, AssemblerError>;
fn to_string(&self) -> String;
fn to_enhanced_string(&self) -> String;
fn inject_labels(&mut self, labels: &[(u16, &str)]);
// Provided methods
fn to_bytes(&self) -> Result<Vec<u8>, AssemblerError> { ... }
fn number_of_bytes(&self) -> Result<usize, AssemblerError> { ... }
fn save<P: AsRef<Path>>(&self, path: P) -> Result<()> { ... }
}Expand description
Additional methods for the listings
Required Methods§
fn add_code<S: AsRef<str> + Display>( &mut self, code: S ) -> Result<(), AssemblerError>
fn to_bytes_with_options( &self, option: EnvOptions ) -> Result<Vec<u8>, AssemblerError>
sourcefn estimated_duration(&self) -> Result<usize, AssemblerError>
fn estimated_duration(&self) -> Result<usize, AssemblerError>
Get the execution duration.
If field duration is set, returns it. Otherwise, compute it
fn to_string(&self) -> String
sourcefn to_enhanced_string(&self) -> String
fn to_enhanced_string(&self) -> String
Generate a string that contains also the bytes panic even for simple corner cases
sourcefn inject_labels(&mut self, labels: &[(u16, &str)])
fn inject_labels(&mut self, labels: &[(u16, &str)])
Modify the listing to inject labels at the given addresses
Provided Methods§
sourcefn to_bytes(&self) -> Result<Vec<u8>, AssemblerError>
fn to_bytes(&self) -> Result<Vec<u8>, AssemblerError>
Assemble the listing (without context) and returns the bytes
sourcefn number_of_bytes(&self) -> Result<usize, AssemblerError>
fn number_of_bytes(&self) -> Result<usize, AssemblerError>
Compute the size of the listing. The listing has a size only if its tokens has a size