Struct muse_lang::vm::bitcode::BitcodeFunction
source · pub struct BitcodeFunction { /* private fields */ }Expand description
An IR Function.
Implementations§
source§impl BitcodeFunction
impl BitcodeFunction
sourcepub fn new(name: impl IntoOptionSymbol) -> Self
pub fn new(name: impl IntoOptionSymbol) -> Self
Returns a new function with name.
sourcepub fn from_function(bit: &Function, guard: &CollectionGuard<'_>) -> Self
pub fn from_function(bit: &Function, guard: &CollectionGuard<'_>) -> Self
Returns a function from the contents of bit.
sourcepub fn insert_arity(
&mut self,
arity: impl Into<Arity>,
body: impl Into<BitcodeBlock>,
)
pub fn insert_arity( &mut self, arity: impl Into<Arity>, body: impl Into<BitcodeBlock>, )
Inserts a new function body to be executed when arity number of
arguments are provided.
sourcepub fn insert_variable_arity(
&mut self,
arity: impl Into<Arity>,
body: impl Into<BitcodeBlock>,
)
pub fn insert_variable_arity( &mut self, arity: impl Into<Arity>, body: impl Into<BitcodeBlock>, )
Inserts a new function body to be executed when arity or more number
of arguments are provided.
sourcepub fn when(
self,
arity: impl Into<Arity>,
body: impl Into<BitcodeBlock>,
) -> Self
pub fn when( self, arity: impl Into<Arity>, body: impl Into<BitcodeBlock>, ) -> Self
Adds a new function body to be executed when arity number of arguments
are provided, and returns self.
sourcepub fn to_function(&self, guard: &CollectionGuard<'_>) -> Function
pub fn to_function(&self, guard: &CollectionGuard<'_>) -> Function
Loads this function for execution in the virtual machine.
Trait Implementations§
source§impl Clone for BitcodeFunction
impl Clone for BitcodeFunction
source§fn clone(&self) -> BitcodeFunction
fn clone(&self) -> BitcodeFunction
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 BitcodeFunction
impl Debug for BitcodeFunction
source§impl<'de> Deserialize<'de> for BitcodeFunction
impl<'de> Deserialize<'de> for BitcodeFunction
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 From<BitcodeFunction> for ValueOrSource
impl From<BitcodeFunction> for ValueOrSource
source§fn from(value: BitcodeFunction) -> Self
fn from(value: BitcodeFunction) -> Self
Converts to this type from the input type.
source§impl PartialEq for BitcodeFunction
impl PartialEq for BitcodeFunction
source§impl Serialize for BitcodeFunction
impl Serialize for BitcodeFunction
impl StructuralPartialEq for BitcodeFunction
Auto Trait Implementations§
impl Freeze for BitcodeFunction
impl RefUnwindSafe for BitcodeFunction
impl Send for BitcodeFunction
impl Sync for BitcodeFunction
impl Unpin for BitcodeFunction
impl UnwindSafe for BitcodeFunction
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
§impl<A> Cast for A
impl<A> Cast for A
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)