pub trait Resource {
type Path: ResourcePath;
// Required method
fn resource_path(&mut self) -> &mut Path<Self::Path>;
}Expand description
Abstraction over types that can provide a mutable Path for routing.
This trait is used by the router to extract the request path in a uniform way across different
request types (e.g., Actix Web’s ServiceRequest). Implementors return a mutable Path
wrapper so routing can read and potentially normalize/parse the path without requiring the
original request type.
Required Associated Types§
Sourcetype Path: ResourcePath
type Path: ResourcePath
Type of resource’s path returned in resource_path.
Required Methods§
Sourcefn resource_path(&mut self) -> &mut Path<Self::Path>
fn resource_path(&mut self) -> &mut Path<Self::Path>
Returns a mutable reference to the path wrapper used by the router.