pub struct Route {
pub method: HttpMethod,
pub path: String,
pub priority: i32,
pub metadata: HashMap<String, Value>,
}
Expand description
Route definition
Fields§
§method: HttpMethod
HTTP method
path: String
Path pattern (supports wildcards)
priority: i32
Route priority (higher = more specific)
metadata: HashMap<String, Value>
Additional metadata
Implementations§
Source§impl Route
impl Route
Sourcepub fn new(method: HttpMethod, path: String) -> Self
pub fn new(method: HttpMethod, path: String) -> Self
Create a new route
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set route priority
Sourcepub fn with_metadata(self, key: String, value: Value) -> Self
pub fn with_metadata(self, key: String, value: Value) -> Self
Add metadata
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Route
impl<'de> Deserialize<'de> for Route
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnwindSafe for Route
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more