Struct tasm_lib::snippet_state::SnippetState
source · pub struct SnippetState { /* private fields */ }
Implementations§
source§impl SnippetState
impl SnippetState
pub fn with_preallocated_memory(words_allocated: usize) -> Self
sourcepub fn import(&mut self, snippet: Box<dyn Snippet>) -> String
pub fn import(&mut self, snippet: Box<dyn Snippet>) -> String
Import T: Snippet
into the library.
This recursively imports T
’s dependencies.
Does not import the snippets with the same entrypoint twice.
Avoid cyclic dependencies by only calling T::function_code()
which
may call .import()
if .import::<T>()
wasn’t already called once.
pub fn explicit_import(&mut self, name: &str, body: String) -> String
sourcepub fn get_next_free_address(&self) -> usize
pub fn get_next_free_address(&self) -> usize
Return the next free address without allocating anything
pub fn all_imports(&self) -> String
pub fn all_imports_as_instruction_lists(&self) -> Vec<LabelledInstruction>
pub fn kmalloc(&mut self, num_words: usize) -> usize
Trait Implementations§
source§impl Clone for SnippetState
impl Clone for SnippetState
source§fn clone(&self) -> SnippetState
fn clone(&self) -> SnippetState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SnippetState
impl Debug for SnippetState
Auto Trait Implementations§
impl RefUnwindSafe for SnippetState
impl Send for SnippetState
impl Sync for SnippetState
impl Unpin for SnippetState
impl UnwindSafe for SnippetState
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