Skip to main content

ProtoMetadata

Struct ProtoMetadata 

Source
#[non_exhaustive]
pub struct ProtoMetadata { /* private fields */ }
Expand description

All RPC metadata extracted from proto descriptors.

Populated once via discover(), then consumed by PatchConfig. Access extracted data through the public accessor methods below.

Implementations§

Source§

impl ProtoMetadata

Source

pub fn streaming_ops(&self) -> &[StreamingOp]

Server-streaming RPCs with HTTP annotations.

Source

pub fn operation_ids(&self) -> &[OperationEntry]

All RPC operation IDs extracted from the descriptor set.

Source

pub fn field_constraints(&self) -> &[SchemaConstraints]

Validation constraints from validate.rules field options.

Source

pub fn enum_rewrites(&self) -> &[EnumRewrite]

Enum value rewrites for prefix-stripped enums.

Source

pub fn redirect_paths(&self) -> &[String]

HTTP paths for redirect endpoints.

Source

pub fn uuid_schema(&self) -> Option<&str>

gnostic schema name for the auto-detected UUID wrapper type.

Source

pub fn path_param_constraints(&self) -> &[PathParamInfo]

Path parameter constraints, keyed by HTTP path template.

Source

pub fn enum_value_map(&self) -> &HashMap<String, String>

Raw → stripped enum value mapping for all prefix-stripped enums.

Source§

impl ProtoMetadata

Test-support utilities for constructing ProtoMetadata fixtures.

These setters bypass the normal discover() path, allowing tests to populate individual fields without a real proto descriptor. Only available when the test-support feature is enabled.

Source

pub fn set_streaming_ops(&mut self, ops: Vec<StreamingOp>)

Set streaming ops (test helper).

Source

pub fn set_operation_ids(&mut self, ids: Vec<OperationEntry>)

Set operation IDs (test helper).

Source

pub fn set_field_constraints(&mut self, constraints: Vec<SchemaConstraints>)

Set field constraints (test helper).

Source

pub fn set_enum_rewrites(&mut self, rewrites: Vec<EnumRewrite>)

Set enum rewrites (test helper).

Source

pub fn set_enum_value_map(&mut self, map: HashMap<String, String>)

Set enum value map (test helper).

Trait Implementations§

Source§

impl Debug for ProtoMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProtoMetadata

Source§

fn default() -> ProtoMetadata

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.