pub struct DbrestRouters {
pub api: Router,
pub admin: Option<Router>,
pub state: AppState,
}Expand description
Output of DbrestApp::build.
Contains the API router, optional admin router, and the AppState for
advanced use (e.g. manually starting a NOTIFY listener or reloading
the schema cache).
Fields§
§api: RouterThe main REST API router.
admin: Option<Router>Optional admin router (health, metrics, config).
state: AppStateThe constructed application state (for lifecycle management).
Implementations§
Source§impl DbrestRouters
impl DbrestRouters
Sourcepub fn merged(self) -> Router
pub fn merged(self) -> Router
Merge the API and admin routers into a single router.
Admin routes are nested under /admin.
Sourcepub fn start_listener(&self) -> Sender<bool>
pub fn start_listener(&self) -> Sender<bool>
Start the NOTIFY listener in the background (if the backend supports it).
Returns a cancel handle — send true to shut down the listener.
Auto Trait Implementations§
impl Freeze for DbrestRouters
impl !RefUnwindSafe for DbrestRouters
impl Send for DbrestRouters
impl Sync for DbrestRouters
impl Unpin for DbrestRouters
impl UnsafeUnpin for DbrestRouters
impl !UnwindSafe for DbrestRouters
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