pub struct BaoEventLoop { /* private fields */ }Expand description
Per-thread Bao event loop backing the Js/Jsc arm of every dispatch
interface in this module.
Wraps a MiniEventLoop<'static> (which owns the uSockets loop, task
queue, pipe-read buffer, file-poll store). SpiderMonkey’s JSContext*
is owned by crate::context::JsContext and borrowed via thread-local
registration; it is not stored here.
§Lifetimes
Stored in a thread_local!; intentionally leaked on thread exit
(SpiderMonkey insists on controlled shutdown order: roots drained →
runtime dropped → engine dropped). std::mem::forget is the right tool.
Implementations§
Source§impl BaoEventLoop
impl BaoEventLoop
Sourcepub fn register_js_context(cx: *mut c_void)
pub fn register_js_context(cx: *mut c_void)
Register a SpiderMonkey JSContext* on this thread’s event loop.
Called by JsContext::init_runtime() / JsContext::for_test().
Sourcepub fn current() -> &'static BaoEventLoop
pub fn current() -> &'static BaoEventLoop
Thread-local accessor matching JSC’s VirtualMachine::get() semantics.
§Panics
Panics if called before JsContext::for_test() registers the context —
mirrors JSC’s panic when no VM is installed on the current thread.
Wave 73-E will add the registration check.
Auto Trait Implementations§
impl !Freeze for BaoEventLoop
impl !RefUnwindSafe for BaoEventLoop
impl !Send for BaoEventLoop
impl !Sync for BaoEventLoop
impl !UnwindSafe for BaoEventLoop
impl Unpin for BaoEventLoop
impl UnsafeUnpin for BaoEventLoop
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,
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