pub trait ProtoTypeResolver:
Debug
+ Send
+ Sync {
// Required methods
fn get_field_type(&self, message: &str, field: &str) -> Option<CelType>;
fn has_message(&self, message: &str) -> bool;
fn is_extension(&self, message: &str, ext_name: &str) -> bool;
fn get_enum_value(&self, enum_name: &str, value_name: &str) -> Option<i32>;
fn resolve_qualified(
&self,
parts: &[&str],
container: &str,
) -> Option<ResolvedProtoType>;
fn resolve_message_name(
&self,
name: &str,
container: &str,
) -> Option<String>;
fn as_any(&self) -> &dyn Any;
// Provided method
fn message_field_names(&self, _message: &str) -> Option<Vec<String>> { ... }
}Expand description
Trait for protobuf descriptor pool access (checker operations).
This trait provides type information needed during type checking, without requiring the ability to construct or manipulate proto messages.
§Object Safety
This trait is object-safe and can be used with dyn ProtoTypeResolver.
§Downcasting
The as_any() method enables downcasting to concrete types. Note that
downcasting only works with the exact concrete type - wrapped or newtype
implementations will not match.
Required Methods§
Sourcefn get_field_type(&self, message: &str, field: &str) -> Option<CelType>
fn get_field_type(&self, message: &str, field: &str) -> Option<CelType>
Get the CEL type of a message field.
Sourcefn has_message(&self, message: &str) -> bool
fn has_message(&self, message: &str) -> bool
Check whether a message type is known to this registry.
Sourcefn is_extension(&self, message: &str, ext_name: &str) -> bool
fn is_extension(&self, message: &str, ext_name: &str) -> bool
Check whether ext_name is a known extension field on message.
Sourcefn get_enum_value(&self, enum_name: &str, value_name: &str) -> Option<i32>
fn get_enum_value(&self, enum_name: &str, value_name: &str) -> Option<i32>
Get the numeric value of an enum constant by name.
Sourcefn resolve_qualified(
&self,
parts: &[&str],
container: &str,
) -> Option<ResolvedProtoType>
fn resolve_qualified( &self, parts: &[&str], container: &str, ) -> Option<ResolvedProtoType>
Resolve a qualified name (dot-separated parts) within a container namespace.
Returns the resolved proto type (Message, Enum, or EnumValue).