pub struct EmbeddedProgram { /* private fields */ }Implementations§
Source§impl EmbeddedProgram
impl EmbeddedProgram
pub fn builder() -> EmbeddedBuilder
pub fn vm_mut(&mut self) -> &mut VM
pub fn signature(&self, function_name: &str) -> Option<&FunctionSignature>
pub fn typed_functions( &self, ) -> impl Iterator<Item = (&String, &FunctionSignature)>
pub fn struct_definition(&self, type_name: &str) -> Option<&StructDef>
pub fn enum_definition(&self, type_name: &str) -> Option<&EnumDef>
pub fn get_global_value(&self, name: &str) -> Option<Value>
pub fn get_typed_global<T: FromLustValue>( &self, name: &str, ) -> Result<Option<T>>
pub fn set_global_value<V: IntoTypedValue>( &mut self, name: impl Into<String>, value: V, )
pub fn struct_instance<I, K, V>( &self, type_name: impl Into<String>, fields: I, ) -> Result<StructInstance>
pub fn enum_variant( &self, type_name: impl Into<String>, variant: impl Into<String>, ) -> Result<EnumInstance>
pub fn enum_variant_with<I, V>(
&self,
type_name: impl Into<String>,
variant: impl Into<String>,
payload: I,
) -> Result<EnumInstance>where
I: IntoIterator<Item = V>,
V: IntoTypedValue,
pub fn register_native_fn<F>(&mut self, name: impl Into<String>, func: F)
pub fn register_typed_native<Args, R, F>(
&mut self,
name: &str,
func: F,
) -> Result<()>where
Args: FromLustArgs,
R: IntoLustValue + FromLustValue,
F: Fn(Args) -> Result<R, String> + 'static,
pub fn call_typed<Args, R>(
&mut self,
function_name: &str,
args: Args,
) -> Result<R>where
Args: FunctionArgs,
R: FromLustValue,
pub fn call_raw( &mut self, function_name: &str, args: Vec<Value>, ) -> Result<Value>
pub fn run_entry_script(&mut self) -> Result<()>
Auto Trait Implementations§
impl Freeze for EmbeddedProgram
impl !RefUnwindSafe for EmbeddedProgram
impl !Send for EmbeddedProgram
impl !Sync for EmbeddedProgram
impl Unpin for EmbeddedProgram
impl !UnwindSafe for EmbeddedProgram
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