pub struct ReloadRoute;Expand description
Route handler for the reload endpoint using long-polling.
Holds the connection open until a reload event is broadcast, then returns a single JSON response so the client can distinguish between a successful rebuild and an error.
Implementations§
Source§impl ReloadRoute
impl ReloadRoute
Trait Implementations§
Source§impl ServerHook for ReloadRoute
Implements ServerHook for ReloadRoute to provide long-polling reload notifications.
impl ServerHook for ReloadRoute
Implements ServerHook for ReloadRoute to provide long-polling reload notifications.
Uses long-polling: holds the connection open until a reload event is broadcast, then returns a single JSON response so the client can distinguish between a successful rebuild and an error.
Source§async fn handle(self, _: &mut Stream, ctx: &mut Context) -> Status
async fn handle(self, _: &mut Stream, ctx: &mut Context) -> Status
Waits for a reload event and returns it as a JSON response.
Subscribes to the broadcast channel and blocks until a ReloadEvent
is received, then serializes it as the response body.
§Arguments
self- The consumed route instance.&mut Stream- The connection stream (unused).&mut Context- The request context used to write the response.
§Returns
Status- The hook processing result.
Auto Trait Implementations§
impl Freeze for ReloadRoute
impl RefUnwindSafe for ReloadRoute
impl Send for ReloadRoute
impl Sync for ReloadRoute
impl Unpin for ReloadRoute
impl UnsafeUnpin for ReloadRoute
impl UnwindSafe for ReloadRoute
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendSync for T
impl<T> AnySync for T
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