pub struct BSHandle(/* private fields */);
Expand description
A handle to a running BS instance. Drop the handle to shutdown the associated background tasks.
Implementations§
Source§impl BSHandle
impl BSHandle
Sourcepub async fn get_env(&self) -> Result<Env<BSCtx, NoUserEvent>>
pub async fn get_env(&self) -> Result<Env<BSCtx, NoUserEvent>>
Get a copy of the current bscript environment
Sourcepub async fn compile(&self, text: ArcStr) -> Result<CompRes>
pub async fn compile(&self, text: ArcStr) -> Result<CompRes>
Compile and execute the specified bscript expression. It can either be a module expression or a single expression. If it generates results, they will be sent to all the channels that are subscribed.
Sourcepub async fn load(&self, path: PathBuf) -> Result<CompRes>
pub async fn load(&self, path: PathBuf) -> Result<CompRes>
Load and execute the specified bscript 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.
Auto Trait Implementations§
impl Freeze for BSHandle
impl !RefUnwindSafe for BSHandle
impl Send for BSHandle
impl Sync for BSHandle
impl Unpin for BSHandle
impl !UnwindSafe for BSHandle
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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