pub struct Registry { /* private fields */ }Expand description
Registry for slots and methods.
This is the core state container for the WebSocket server. It stores available slots and registered methods.
Implementations§
Source§impl Registry
impl Registry
Sourcepub async fn get_slots_filtered(&self, prefix: Option<&str>) -> Vec<SlotInfo>
pub async fn get_slots_filtered(&self, prefix: Option<&str>) -> Vec<SlotInfo>
Get slots filtered by path prefix.
Sourcepub async fn get_input_paths(&self) -> Vec<String>
pub async fn get_input_paths(&self) -> Vec<String>
Get input slots (slots with kind == “input”).
Sourcepub async fn register_method<H>(&self, info: MethodInfo, handler: H)where
H: RegistryMethodHandler + 'static,
pub async fn register_method<H>(&self, info: MethodInfo, handler: H)where
H: RegistryMethodHandler + 'static,
Register a method with its handler.
Sourcepub async fn register_method_fn<F>(&self, info: MethodInfo, handler: F)
pub async fn register_method_fn<F>(&self, info: MethodInfo, handler: F)
Register a method using a closure.
Sourcepub async fn get_methods(&self) -> Vec<MethodInfo>
pub async fn get_methods(&self) -> Vec<MethodInfo>
Get all registered methods.
Sourcepub async fn get_methods_filtered(
&self,
prefix: Option<&str>,
) -> Vec<MethodInfo>
pub async fn get_methods_filtered( &self, prefix: Option<&str>, ) -> Vec<MethodInfo>
Get methods filtered by path prefix.
Sourcepub async fn invoke_method(
&self,
path: &str,
args: HashMap<String, Value>,
) -> InvokeResult
pub async fn invoke_method( &self, path: &str, args: HashMap<String, Value>, ) -> InvokeResult
Invoke a method by path.
Sourcepub async fn has_method(&self, path: &str) -> bool
pub async fn has_method(&self, path: &str) -> bool
Check if a method exists.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Registry
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
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