pub struct TypeRegistry { /* private fields */ }json or text only.Expand description
Unified registry: JSON Any + extension entries (under json) and
text Any + extension entries (under text).
Populate with generated register_types(&mut reg) functions, then
install once with set_type_registry. The JSON half delegates to the
existing AnyRegistry and
ExtensionRegistry types;
the text half uses parallel maps. Both axes’ lookup indirection
(by_name → by_number) is preserved.
Implementations§
Source§impl TypeRegistry
impl TypeRegistry
Sourcepub fn register_json_any(&mut self, entry: JsonAnyEntry)
Available on crate feature json only.
pub fn register_json_any(&mut self, entry: JsonAnyEntry)
json only.Registers a JSON Any type entry. Replaces any existing entry for
the same type URL.
Sourcepub fn register_json_ext(&mut self, entry: JsonExtEntry)
Available on crate feature json only.
pub fn register_json_ext(&mut self, entry: JsonExtEntry)
json only.Registers a JSON extension entry. Replaces any existing entry at the
same (extendee, number) or full_name.
Sourcepub fn register_text_any(&mut self, entry: TextAnyEntry)
Available on crate feature text only.
pub fn register_text_any(&mut self, entry: TextAnyEntry)
text only.Registers a text Any type entry.
Sourcepub fn register_text_ext(&mut self, entry: TextExtEntry)
Available on crate feature text only.
pub fn register_text_ext(&mut self, entry: TextExtEntry)
text only.Registers a text extension entry.
Sourcepub fn json_any_by_url(&self, type_url: &str) -> Option<&JsonAnyEntry>
Available on crate feature json only.
pub fn json_any_by_url(&self, type_url: &str) -> Option<&JsonAnyEntry>
json only.Look up a JSON Any entry by type URL.
Sourcepub fn json_ext_by_number(
&self,
extendee: &str,
number: u32,
) -> Option<&JsonExtEntry>
Available on crate feature json only.
pub fn json_ext_by_number( &self, extendee: &str, number: u32, ) -> Option<&JsonExtEntry>
json only.Look up a JSON extension entry by (extendee, number).
Sourcepub fn json_ext_by_name(&self, full_name: &str) -> Option<&JsonExtEntry>
Available on crate feature json only.
pub fn json_ext_by_name(&self, full_name: &str) -> Option<&JsonExtEntry>
json only.Look up a JSON extension entry by full name.
Sourcepub fn text_any_by_url(&self, type_url: &str) -> Option<&TextAnyEntry>
Available on crate feature text only.
pub fn text_any_by_url(&self, type_url: &str) -> Option<&TextAnyEntry>
text only.Look up a text Any entry by type URL.
Sourcepub fn text_ext_by_number(
&self,
extendee: &str,
number: u32,
) -> Option<&TextExtEntry>
Available on crate feature text only.
pub fn text_ext_by_number( &self, extendee: &str, number: u32, ) -> Option<&TextExtEntry>
text only.Look up a text extension entry by (extendee, number).
Sourcepub fn text_ext_by_name(&self, full_name: &str) -> Option<&TextExtEntry>
Available on crate feature text only.
pub fn text_ext_by_name(&self, full_name: &str) -> Option<&TextExtEntry>
text only.Look up a text extension entry by full name.