pub struct HttpRouteRegistry { /* private fields */ }Implementations§
Source§impl HttpRouteRegistry
impl HttpRouteRegistry
pub fn new() -> Self
pub async fn register_api_route( &self, path: String, sender: Sender<RequestEnvelope>, )
pub async fn unregister_api_route(&self, path: &str)
Sourcepub async fn register_rest_endpoint(
&self,
method: String,
segments: Vec<PathSegment>,
sender: Sender<RequestEnvelope>,
)
pub async fn register_rest_endpoint( &self, method: String, segments: Vec<PathSegment>, sender: Sender<RequestEnvelope>, )
Register a method-aware REST endpoint. Two endpoints on the same
path with different methods coexist; two endpoints with the same
(method, path) overwrite (last write wins), matching the
semantics expected for re-registration of the same logical route.
Sourcepub async fn unregister_rest_endpoint(&self, method: &str, path_template: &str)
pub async fn unregister_rest_endpoint(&self, method: &str, path_template: &str)
Remove the REST endpoint matching (method, path_template).
Only the endpoint with the SAME method AND segments is removed —
other HTTP methods sharing the path template are preserved. Stopping
the GET /users consumer must not tear down the live POST /users
endpoint (the core REST multi-verb use case). Fixes review C1.
Sourcepub async fn register_static_mount(
&self,
mount: StaticMount,
) -> Result<(), CamelError>
pub async fn register_static_mount( &self, mount: StaticMount, ) -> Result<(), CamelError>
Register a static mount. Duplicate detection is by mount_path
only — every mount on a given port must have a unique prefix.
A single SPA mount is still the convention, but it is no longer
enforced structurally; the dispatch loop treats all mounts
uniformly (sorted by longest prefix) and uses mode to decide
whether to attempt SPA-fallback after ServeDir fails.
Sourcepub async fn unregister_static_mount(&self, mount_path: &str)
pub async fn unregister_static_mount(&self, mount_path: &str)
Unregister a static mount by its unique mount_path.
Trait Implementations§
Source§impl Clone for HttpRouteRegistry
impl Clone for HttpRouteRegistry
Source§fn clone(&self) -> HttpRouteRegistry
fn clone(&self) -> HttpRouteRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpRouteRegistry
impl Debug for HttpRouteRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for HttpRouteRegistry
impl !UnwindSafe for HttpRouteRegistry
impl Freeze for HttpRouteRegistry
impl Send for HttpRouteRegistry
impl Sync for HttpRouteRegistry
impl Unpin for HttpRouteRegistry
impl UnsafeUnpin for HttpRouteRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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 more