pub struct ProtocolRegistry { /* private fields */ }Expand description
Registry for protocol adapters, mapping protocol names to implementations.
Supports URL-based routing: adapters register URL prefixes, and the registry resolves which adapter handles a given URL.
Implementations§
Source§impl ProtocolRegistry
impl ProtocolRegistry
Sourcepub fn register(
&mut self,
name: &str,
adapter: Arc<dyn ProtocolAdapter>,
url_prefixes: Vec<&str>,
)
pub fn register( &mut self, name: &str, adapter: Arc<dyn ProtocolAdapter>, url_prefixes: Vec<&str>, )
Register an adapter with a protocol name and URL prefixes.
Sourcepub fn adapter(&self, name: &str) -> Option<&dyn ProtocolAdapter>
pub fn adapter(&self, name: &str) -> Option<&dyn ProtocolAdapter>
Look up an adapter by protocol name.
Sourcepub fn adapter_for_url(&self, url: &str) -> Option<&dyn ProtocolAdapter>
pub fn adapter_for_url(&self, url: &str) -> Option<&dyn ProtocolAdapter>
Find the adapter that handles a given URL.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtocolRegistry
impl !RefUnwindSafe for ProtocolRegistry
impl Send for ProtocolRegistry
impl Sync for ProtocolRegistry
impl Unpin for ProtocolRegistry
impl UnsafeUnpin for ProtocolRegistry
impl !UnwindSafe for ProtocolRegistry
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