Skip to content

Commit 02db640

Browse files
committed
Seal the LeptosRoutes trait.
1 parent d47b8ae commit 02db640

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

integrations/axum/src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ use tower::util::ServiceExt;
8888
use tower_http::services::ServeDir;
8989
// use tracing::Instrument; // TODO check tracing span -- was this used in 0.6 for a missing link?
9090

91+
mod private {
92+
pub trait Sealed {}
93+
94+
impl<S> Sealed for axum::Router<S> {}
95+
}
96+
9197
mod service;
9298
pub use service::ErrorHandler;
9399

@@ -1614,7 +1620,10 @@ where
16141620

16151621
/// This trait allows one to pass a list of routes and a render function to Axum's router, letting us avoid
16161622
/// having to use wildcards or manually define all routes in multiple places.
1617-
pub trait LeptosRoutes<S>
1623+
///
1624+
/// This trait is sealed and cannot be implemented for callers to avoid breaking backwards compatibility when
1625+
/// new methods are added.
1626+
pub trait LeptosRoutes<S>: private::Sealed
16181627
where
16191628
S: Clone + Send + Sync + 'static,
16201629
LeptosOptions: FromRef<S>,

0 commit comments

Comments
 (0)