pub struct InterfaceRegistry { /* private fields */ }Expand description
Registry for interfaces and their handlers
Implementations§
Source§impl InterfaceRegistry
impl InterfaceRegistry
pub fn new() -> Self
Sourcepub async fn register(
&self,
registration: InterfaceRegistration,
handler: Arc<dyn RpcHandler>,
) -> Result<(), String>
pub async fn register( &self, registration: InterfaceRegistration, handler: Arc<dyn RpcHandler>, ) -> Result<(), String>
Register an interface with its handler
Sourcepub async fn deregister(&self, interface_id: InterfaceId) -> Result<(), String>
pub async fn deregister(&self, interface_id: InterfaceId) -> Result<(), String>
Deregister an interface
Sourcepub async fn route(&self, request: RpcRequest) -> RpcResponse
pub async fn route(&self, request: RpcRequest) -> RpcResponse
Route a request to the appropriate handler
Sourcepub async fn list_interfaces(&self) -> Vec<InterfaceRegistration>
pub async fn list_interfaces(&self) -> Vec<InterfaceRegistration>
List all registered interfaces
Sourcepub async fn has_interface(&self, interface_id: InterfaceId) -> bool
pub async fn has_interface(&self, interface_id: InterfaceId) -> bool
Check if an interface is registered
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InterfaceRegistry
impl !RefUnwindSafe for InterfaceRegistry
impl Send for InterfaceRegistry
impl Sync for InterfaceRegistry
impl Unpin for InterfaceRegistry
impl UnsafeUnpin for InterfaceRegistry
impl !UnwindSafe for InterfaceRegistry
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