pub struct RadixNode {
pub segment: PathSegment,
pub handler: Option<RiRouteHandler>,
pub route_data: Option<RiRoute>,
pub children: HashMap<String, Arc<RwLock<RadixNode>>>,
pub param_child: Option<Arc<RwLock<RadixNode>>>,
pub wildcard_child: Option<Arc<RwLock<RadixNode>>>,
}Expand description
A node in the radix tree.
Each node represents a path segment and may contain:
- A route handler (if this node is a terminal)
- Child nodes for further path segments
- Parameter and wildcard children for dynamic matching
Fields§
§segment: PathSegmentThe path segment this node represents
handler: Option<RiRouteHandler>Route handler if this node is a terminal
route_data: Option<RiRoute>Route data if this node is a terminal
children: HashMap<String, Arc<RwLock<RadixNode>>>Static children (exact match segments)
param_child: Option<Arc<RwLock<RadixNode>>>Parameter child (for :param segments)
wildcard_child: Option<Arc<RwLock<RadixNode>>>Wildcard child (for *path segments)
Implementations§
Source§impl RadixNode
impl RadixNode
Sourcepub fn new(segment: PathSegment) -> Self
pub fn new(segment: PathSegment) -> Self
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Checks if this node is a terminal (has a handler).
§Returns
true if this node has a handler, false otherwise
Sourcepub fn add_static_child(
&mut self,
segment: PathSegment,
) -> Arc<RwLock<RadixNode>>
pub fn add_static_child( &mut self, segment: PathSegment, ) -> Arc<RwLock<RadixNode>>
Sourcepub fn get_or_create_child(
&mut self,
segment: PathSegment,
) -> Arc<RwLock<RadixNode>>
pub fn get_or_create_child( &mut self, segment: PathSegment, ) -> Arc<RwLock<RadixNode>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RadixNode
impl !RefUnwindSafe for RadixNode
impl Send for RadixNode
impl Sync for RadixNode
impl Unpin for RadixNode
impl UnsafeUnpin for RadixNode
impl !UnwindSafe for RadixNode
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request