pub struct MethodRegistry { /* private fields */ }Expand description
Registry of method metadata.
Servers consult the registry on every request to decide role / rate /
allow-list enforcement. Clone is cheap (Arc internally).
Implementations§
Source§impl MethodRegistry
impl MethodRegistry
Sourcepub fn register(&self, meta: MethodMeta)
pub fn register(&self, meta: MethodMeta)
Register a method. Overwrites any existing entry with the same name.
Sourcepub fn get(&self, name: &str) -> Option<MethodMeta>
pub fn get(&self, name: &str) -> Option<MethodMeta>
Look up metadata for a method. None if not registered (server
should respond with MethodNotFound).
Sourcepub fn register_all(&self, metas: impl IntoIterator<Item = MethodMeta>)
pub fn register_all(&self, metas: impl IntoIterator<Item = MethodMeta>)
Register multiple methods at once.
Trait Implementations§
Source§impl Debug for MethodRegistry
impl Debug for MethodRegistry
Source§impl Default for MethodRegistry
impl Default for MethodRegistry
Source§fn default() -> MethodRegistry
fn default() -> MethodRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MethodRegistry
impl !RefUnwindSafe for MethodRegistry
impl Send for MethodRegistry
impl Sync for MethodRegistry
impl Unpin for MethodRegistry
impl UnsafeUnpin for MethodRegistry
impl UnwindSafe for MethodRegistry
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