pub struct HandlerRegistry { /* private fields */ }Expand description
Registry of event handlers for validation.
Implementations§
Source§impl HandlerRegistry
impl HandlerRegistry
Sourcepub fn load_from_json(path: &Path) -> Result<Self, Box<dyn Error>>
pub fn load_from_json(path: &Path) -> Result<Self, Box<dyn Error>>
Loads a handler registry from a JSON file.
§Arguments
path- Path to the JSON file containing handler definitions
§Returns
A Result containing the registry or an error if loading fails.
§Example JSON format
[
{
"name": "increment",
"param_type": null,
"returns_command": false
},
{
"name": "setValue",
"param_type": "i32",
"returns_command": true
}
]Sourcepub fn add_handler(&mut self, handler: HandlerDefinition)
pub fn add_handler(&mut self, handler: HandlerDefinition)
Adds a handler to the registry.
Trait Implementations§
Source§impl Clone for HandlerRegistry
impl Clone for HandlerRegistry
Source§fn clone(&self) -> HandlerRegistry
fn clone(&self) -> HandlerRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HandlerRegistry
impl Debug for HandlerRegistry
Source§impl Default for HandlerRegistry
impl Default for HandlerRegistry
Source§fn default() -> HandlerRegistry
fn default() -> HandlerRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HandlerRegistry
impl RefUnwindSafe for HandlerRegistry
impl Send for HandlerRegistry
impl Sync for HandlerRegistry
impl Unpin for HandlerRegistry
impl UnwindSafe for HandlerRegistry
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