Struct polkavm_linker::ProgramBlob
source · pub struct ProgramBlob { /* private fields */ }
Expand description
A partially deserialized PolkaVM program.
Implementations§
source§impl ProgramBlob
impl ProgramBlob
sourcepub fn parse(bytes: ArcBytes) -> Result<ProgramBlob, ProgramParseError>
pub fn parse(bytes: ArcBytes) -> Result<ProgramBlob, ProgramParseError>
Parses the given bytes into a program blob.
sourcepub fn from_parts(parts: ProgramParts) -> Result<ProgramBlob, ProgramParseError>
pub fn from_parts(parts: ProgramParts) -> Result<ProgramBlob, ProgramParseError>
Creates a program blob from parts.
sourcepub fn ro_data(&self) -> &[u8] ⓘ
pub fn ro_data(&self) -> &[u8] ⓘ
Returns the contents of the read-only data section.
This only covers the initial non-zero portion of the section; use ro_data_size
to get the full size.
sourcepub fn ro_data_size(&self) -> u32
pub fn ro_data_size(&self) -> u32
Returns the size of the read-only data section.
This can be larger than the length of ro_data
, in which case the rest of the space is assumed to be filled with zeros.
sourcepub fn rw_data(&self) -> &[u8] ⓘ
pub fn rw_data(&self) -> &[u8] ⓘ
Returns the contents of the read-write data section.
This only covers the initial non-zero portion of the section; use rw_data_size
to get the full size.
sourcepub fn rw_data_size(&self) -> u32
pub fn rw_data_size(&self) -> u32
Returns the size of the read-write data section.
This can be larger than the length of rw_data
, in which case the rest of the space is assumed to be filled with zeros.
sourcepub fn stack_size(&self) -> u32
pub fn stack_size(&self) -> u32
Returns the initial size of the stack.
pub fn imports(&self) -> Imports<'_>
sourcepub fn exports(&self) -> impl Iterator<Item = ProgramExport<&[u8]>> + Clone
pub fn exports(&self) -> impl Iterator<Item = ProgramExport<&[u8]>> + Clone
Returns an iterator over program exports.
pub fn instructions(&self) -> Instructions<'_>
pub fn instructions_at( &self, offset: ProgramCounter, ) -> Option<Instructions<'_>>
sourcepub fn jump_table(&self) -> JumpTable<'_>
pub fn jump_table(&self) -> JumpTable<'_>
Returns a jump table.
sourcepub fn get_debug_string(&self, offset: u32) -> Result<&str, ProgramParseError>
pub fn get_debug_string(&self, offset: u32) -> Result<&str, ProgramParseError>
Returns the debug string for the given relative offset.
sourcepub fn get_debug_line_program_at(
&self,
program_counter: ProgramCounter,
) -> Result<Option<LineProgram<'_>>, ProgramParseError>
pub fn get_debug_line_program_at( &self, program_counter: ProgramCounter, ) -> Result<Option<LineProgram<'_>>, ProgramParseError>
Returns the line program for the given instruction.
Trait Implementations§
source§impl Clone for ProgramBlob
impl Clone for ProgramBlob
source§fn clone(&self) -> ProgramBlob
fn clone(&self) -> ProgramBlob
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for ProgramBlob
impl Default for ProgramBlob
source§fn default() -> ProgramBlob
fn default() -> ProgramBlob
Auto Trait Implementations§
impl Freeze for ProgramBlob
impl RefUnwindSafe for ProgramBlob
impl Send for ProgramBlob
impl Sync for ProgramBlob
impl Unpin for ProgramBlob
impl UnwindSafe for ProgramBlob
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)