pub struct Unit { /* private fields */ }Expand description
Instructions from a single source file.
Implementations
sourceimpl Unit
impl Unit
sourcepub fn debug_info(&self) -> Option<&DebugInfo>
pub fn debug_info(&self) -> Option<&DebugInfo>
Access debug information for the given location if it is available.
sourcepub fn instruction_at(&self, ip: usize) -> Option<&Inst>
pub fn instruction_at(&self, ip: usize) -> Option<&Inst>
Get the instruction at the given instruction pointer.
sourcepub fn iter_static_strings(
&self
) -> impl Iterator<Item = &Arc<StaticString>> + '_
pub fn iter_static_strings(
&self
) -> impl Iterator<Item = &Arc<StaticString>> + '_
Iterate over all static strings in the unit.
sourcepub fn iter_constants(&self) -> impl Iterator<Item = (&Hash, &ConstValue)> + '_
pub fn iter_constants(&self) -> impl Iterator<Item = (&Hash, &ConstValue)> + '_
Iterate over all constants in the unit.
sourcepub fn iter_static_object_keys(
&self
) -> impl Iterator<Item = (usize, &[String])> + '_
pub fn iter_static_object_keys(
&self
) -> impl Iterator<Item = (usize, &[String])> + '_
Iterate over all static object keys in the unit.
sourcepub fn iter_instructions(&self) -> impl Iterator<Item = Inst> + '_
pub fn iter_instructions(&self) -> impl Iterator<Item = Inst> + '_
Iterate over all instructions in order.
sourcepub fn iter_functions(&self) -> impl Iterator<Item = (Hash, &UnitFn)> + '_
pub fn iter_functions(&self) -> impl Iterator<Item = (Hash, &UnitFn)> + '_
Iterate over dynamic functions.
sourcepub fn lookup_string(&self, slot: usize) -> Result<&Arc<StaticString>, VmError>
pub fn lookup_string(&self, slot: usize) -> Result<&Arc<StaticString>, VmError>
Lookup the static string by slot, if it exists.
sourcepub fn lookup_bytes(&self, slot: usize) -> Result<&[u8], VmError>
pub fn lookup_bytes(&self, slot: usize) -> Result<&[u8], VmError>
Lookup the static byte string by slot, if it exists.
sourcepub fn lookup_object_keys(&self, slot: usize) -> Option<&[String]>
pub fn lookup_object_keys(&self, slot: usize) -> Option<&[String]>
Lookup the static object keys by slot, if it exists.
sourcepub fn lookup_rtti(&self, hash: Hash) -> Option<&Arc<Rtti>>
pub fn lookup_rtti(&self, hash: Hash) -> Option<&Arc<Rtti>>
Lookup runt-time information for the given type hash.
sourcepub fn lookup_variant_rtti(&self, hash: Hash) -> Option<&Arc<VariantRtti>>
pub fn lookup_variant_rtti(&self, hash: Hash) -> Option<&Arc<VariantRtti>>
Lookup variant runt-time information for the given variant hash.
sourcepub fn constant(&self, hash: Hash) -> Option<&ConstValue>
pub fn constant(&self, hash: Hash) -> Option<&ConstValue>
Lookup a constant from the unit.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Unit
impl<'de> Deserialize<'de> for Unit
sourcefn 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
Auto Trait Implementations
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more