pub struct ContextBindingRegistry { /* private fields */ }Expand description
Registry for context-level exposed functions.
Functions registered here will be exposed to all pages in the context, including pages created after the function is exposed.
Implementations§
Source§impl ContextBindingRegistry
impl ContextBindingRegistry
Sourcepub async fn expose_function<F, Fut>(&self, name: &str, callback: F)
pub async fn expose_function<F, Fut>(&self, name: &str, callback: F)
Register a function to be exposed to all pages.
Sourcepub async fn remove_function(&self, name: &str) -> bool
pub async fn remove_function(&self, name: &str) -> bool
Remove an exposed function.
Sourcepub async fn get_all(&self) -> Vec<ContextBinding>
pub async fn get_all(&self) -> Vec<ContextBinding>
Get all registered bindings.
Trait Implementations§
Source§impl Default for ContextBindingRegistry
impl Default for ContextBindingRegistry
Source§fn default() -> ContextBindingRegistry
fn default() -> ContextBindingRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ContextBindingRegistry
impl !RefUnwindSafe for ContextBindingRegistry
impl Send for ContextBindingRegistry
impl Sync for ContextBindingRegistry
impl Unpin for ContextBindingRegistry
impl !UnwindSafe for ContextBindingRegistry
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