pub struct Unit<S = DefaultStorage> { /* private fields */ }Expand description
Instructions and debug info from a single compilation.
See rune::prepare for more.
Implementations§
Source§impl Unit
impl Unit
Sourcepub fn emit_instructions<O>(
&self,
out: &mut O,
sources: &Sources,
without_source: bool,
) -> Result<()>where
O: WriteColor,
Available on crate feature emit only.
pub fn emit_instructions<O>(
&self,
out: &mut O,
sources: &Sources,
without_source: bool,
) -> Result<()>where
O: WriteColor,
emit only.Dump instructions in a human readable manner.
Source§impl<S> Unit<S>
impl<S> Unit<S>
Sourcepub fn from_parts(data: Logic<S>, debug: Option<DebugInfo>) -> Result<Self>
pub fn from_parts(data: Logic<S>, debug: Option<DebugInfo>) -> Result<Self>
Constructs a new unit from a pair of data and debug info.
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 globals_len(&self) -> usize
pub fn globals_len(&self) -> usize
The number of static slots declared in this unit.
This is the size that a Globals storage constructed for this unit
will have.
Sourcepub fn global_slot(&self, hash: &Hash) -> Option<usize>
pub fn global_slot(&self, hash: &Hash) -> Option<usize>
Lookup the slot assigned to the static item with the given type hash.
This is how a caller addresses a static by item without having to know its slot.
Trait Implementations§
Source§impl<'__de, S, __A> Decode<'__de, Text, __A> for Unit<S>
Available on crate feature musli only.
impl<'__de, S, __A> Decode<'__de, Text, __A> for Unit<S>
Available on crate feature
musli only.Source§const IS_BITWISE_DECODE: bool = false
const IS_BITWISE_DECODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl<'de, S, A> Decode<'de, Binary, A> for Unit<S>
Available on crate feature musli only.
impl<'de, S, A> Decode<'de, Binary, A> for Unit<S>
Available on crate feature
musli only.Source§const IS_BITWISE_DECODE: bool = false
const IS_BITWISE_DECODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl<'de, S> Deserialize<'de> for Unit<S>where
S: Serialize + DeserializeOwned,
Available on crate feature serde only.
impl<'de, S> Deserialize<'de> for Unit<S>where
S: Serialize + DeserializeOwned,
Available on crate feature
serde only.Source§fn 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
Source§impl<S> Encode<Binary> for Unit<S>
Available on crate feature musli only.
impl<S> Encode<Binary> for Unit<S>
Available on crate feature
musli only.Source§const IS_BITWISE_ENCODE: bool = false
const IS_BITWISE_ENCODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl<S> Encode<Text> for Unit<S>
Available on crate feature musli only.
impl<S> Encode<Text> for Unit<S>
Available on crate feature
musli only.Source§const IS_BITWISE_ENCODE: bool = false
const IS_BITWISE_ENCODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Auto Trait Implementations§
impl<S> Freeze for Unit<S>where
S: Freeze,
impl<S> RefUnwindSafe for Unit<S>where
S: RefUnwindSafe,
impl<S> Send for Unit<S>where
S: Send,
impl<S> Sync for Unit<S>where
S: Sync,
impl<S> Unpin for Unit<S>where
S: Unpin,
impl<S> UnsafeUnpin for Unit<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Unit<S>where
S: UnwindSafe,
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
Mutably borrows from an owned value. Read more