Skip to main content

DocPathParams

Trait DocPathParams 

Source
pub trait DocPathParams {
    // Required method
    fn describe(op: &mut Operation, path_param_names: &[&'static str]);
}
Expand description

Contributes path parameters to an operation.

Handles three shapes via separate impls:

  • struct form — Path<T: IntoParams> with #[into_params(parameter_in = Path)] on T; names come from the struct’s field identifiers.
  • scalar form — Path<T: PathScalar> for primitives; names[0] provides the parameter name from the route template.
  • tuple form — Path<(T1, …, Tn)> where every element is PathScalar; names[i] provides the i-th parameter name.

Required Methods§

Source

fn describe(op: &mut Operation, path_param_names: &[&'static str])

Append path parameters to op.parameters.

path_param_names is the ordered list of {name} segments parsed from the route template.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: IntoParams> DocPathParams for Path<T>

Struct-form path impl — names come from T::into_params.

Source§

fn describe(op: &mut Operation, _path_param_names: &[&'static str])

Implementors§