TypedPath

Trait TypedPath 

Source
pub trait TypedPath:
    Serialize
    + DeserializeOwned
    + Send
    + Sync
    + 'static {
    const PATH: &'static str;

    // Required method
    fn to_uri(&self) -> String;
}
Expand description

Trait for defining typed paths

This trait allows structs to define their own path pattern and URL generation logic. It is usually implemented via #[derive(TypedPath)].

Required Associated Constants§

Source

const PATH: &'static str

The URL path pattern (e.g., “/users/{id}”)

Required Methods§

Source

fn to_uri(&self) -> String

Convert the struct fields to a path string

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.

Implementors§