pub struct BaoRuntime { /* private fields */ }Implementations§
Source§impl BaoRuntime
impl BaoRuntime
pub fn new() -> Result<BaoRuntime, JsError>
pub fn eval(&mut self, source: &str, filename: &str) -> Result<JsValue, JsError>
pub fn eval_module( &mut self, source: &str, filename: &str, ) -> Result<JsValue, JsError>
pub fn run_file(&mut self, path: &str) -> Result<JsValue, JsError>
Sourcepub fn run_test_file(&mut self, path: &str) -> Result<TestReport, JsError>
pub fn run_test_file(&mut self, path: &str) -> Result<TestReport, JsError>
Load and execute a test file, then run the registered bun:test
suites while the realm that registered them is still alive. Returns
a full report (counters + named passes/failures).
Files that don’t look like modules fall back to plain eval in the
same persistent realm; a plain script cannot register bun:test suites
via the module loader, so the report is empty — test files should use
ESM/TS syntax.
Sourcepub fn run_registered_tests(&mut self) -> TestReport
pub fn run_registered_tests(&mut self) -> TestReport
Drive the bun:test suites registered in this context’s persistent
realm and return the report. bao test calls this after evaluating
each test file — module files via eval_module_in_realm_then’s
callback (which runs inside AutoRealm), plain-script files and
bao test -e evals directly here — so every entry path executes what
it registered instead of reporting a vacuous 0/0.
Auto Trait Implementations§
impl !Send for BaoRuntime
impl !Sync for BaoRuntime
impl Freeze for BaoRuntime
impl RefUnwindSafe for BaoRuntime
impl Unpin for BaoRuntime
impl UnsafeUnpin for BaoRuntime
impl UnwindSafe for BaoRuntime
Blanket Implementations§
Source§impl<T> AsCtxPtr for Twhere
T: ?Sized,
impl<T> AsCtxPtr for Twhere
T: ?Sized,
Source§fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
self’s address as *mut Self for deferred-task / scopeguard /
ref_guard ctx slots. The closures/trampolines deref it as shared
(&*p) — every method they reach is &self post-R-2, so no write
provenance is required; the *mut spelling is purely to match the
existing DerefOnDrop / HasAutoFlush / RefCount ABI.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more