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 more