pub struct GXHandle(/* private fields */);Expand description
A handle to a running GX instance. Drop the handle to shutdown the associated background tasks.
Implementations§
Source§impl GXHandle
impl GXHandle
Sourcepub async fn get_env(&self) -> Result<Env<GXCtx, NoUserEvent>>
pub async fn get_env(&self) -> Result<Env<GXCtx, NoUserEvent>>
Get a copy of the current graphix environment
Sourcepub async fn compile(&self, text: ArcStr) -> Result<CompRes>
pub async fn compile(&self, text: ArcStr) -> Result<CompRes>
Compile and execute the specified graphix expression. If it generates
results, they will be sent to all the channels that are subscribed. When
the CompExp objects contained in the CompRes are dropped their
corresponding expressions will be deleted. Therefore, you can stop
execution of the whole expression by dropping the returned CompRes.
Sourcepub async fn load(&self, path: PathBuf) -> Result<CompRes>
pub async fn load(&self, path: PathBuf) -> Result<CompRes>
Load and execute the specified graphix module. The path may have one of
two forms. If it is the path to a file with extension .bs then the rt
will load the file directly. If it is a modpath (e.g. foo::bar::baz)
then the module resolver will look for a matching module in the modpath.
When the CompExp objects contained in the CompRes are dropped their
corresponding expressions will be deleted. Therefore, you can stop
execution of the whole file by dropping the returned CompRes.
Sourcepub async fn compile_callable(&self, id: Value) -> Result<Callable>
pub async fn compile_callable(&self, id: Value) -> Result<Callable>
Compile a callable interface to the specified lambda id. This is how you
call a lambda directly from rust. When the returned Callable is
dropped the associated callsite will be delete.