Resource

Trait Resource 

Source
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§

Source

type Path: ResourcePath

Type of resource’s path returned in resource_path.

Required Methods§

Source

fn resource_path(&mut self) -> &mut Path<Self::Path>

Returns a mutable reference to the path wrapper used by the router.

Implementors§

Source§

impl<T, P> Resource for T
where T: DerefMut<Target = Path<P>>, P: ResourcePath,

Source§

type Path = P

Source§

impl<T: ResourcePath> Resource for Path<T>

Source§

type Path = T