pub struct FnRegistry { /* private fields */ }Expand description
Registry of all TypeScript functions available to the runtime.
Populated at startup when the Bun process reports its registered functions. Used by the router to validate function calls and by Studio to show available functions.
Implementations§
Source§impl FnRegistry
impl FnRegistry
pub fn new() -> Self
Sourcepub fn register(&self, def: FnDef)
pub fn register(&self, def: FnDef)
Register a function. Called during startup handshake with the Bun process.
Sourcepub fn register_all(&self, defs: Vec<FnDef>)
pub fn register_all(&self, defs: Vec<FnDef>)
Register multiple functions at once (from startup handshake).
Sourcepub fn replace_all(&self, defs: Vec<FnDef>)
pub fn replace_all(&self, defs: Vec<FnDef>)
Atomically replace the entire registered set. Used after the runtime
supervisor respawns Bun: any function that was deleted between
processes must stop being callable, and register_all() alone won’t
remove stale entries.
Sourcepub fn list_by_type(&self, fn_type: FnType) -> Vec<FnDef>
pub fn list_by_type(&self, fn_type: FnType) -> Vec<FnDef>
List functions of a specific type.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FnRegistry
impl RefUnwindSafe for FnRegistry
impl Send for FnRegistry
impl Sync for FnRegistry
impl Unpin for FnRegistry
impl UnsafeUnpin for FnRegistry
impl UnwindSafe for FnRegistry
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