pub struct CandidateRoute {
pub pattern: String,
pub methods: Vec<String>,
pub handler: Option<String>,
pub result: MatchResult,
pub partial_match: bool,
}Expand description
Information about a candidate route that was considered.
Fields§
§pattern: StringRoute pattern (e.g., “/users/{id}”).
methods: Vec<String>Allowed HTTP methods for this route.
handler: Option<String>Handler function name.
result: MatchResultMatch result for this candidate.
partial_match: boolWhether this route partially matched (path ok, method wrong).
Implementations§
Source§impl CandidateRoute
impl CandidateRoute
Sourcepub fn new(pattern: impl Into<String>, result: MatchResult) -> Self
pub fn new(pattern: impl Into<String>, result: MatchResult) -> Self
Create a new candidate route.
Sourcepub fn methods(
self,
methods: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn methods( self, methods: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set the allowed methods.
Sourcepub fn partial_match(self, partial: bool) -> Self
pub fn partial_match(self, partial: bool) -> Self
Mark as partial match.
Trait Implementations§
Source§impl Clone for CandidateRoute
impl Clone for CandidateRoute
Source§fn clone(&self) -> CandidateRoute
fn clone(&self) -> CandidateRoute
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CandidateRoute
impl RefUnwindSafe for CandidateRoute
impl Send for CandidateRoute
impl Sync for CandidateRoute
impl Unpin for CandidateRoute
impl UnwindSafe for CandidateRoute
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