pub struct HmrHub { /* private fields */ }Expand description
Shared concurrent state coordinating SSE reload notifications, OTA bundles, and server shutdown.
Implementations§
Source§impl HmrHub
Thread-safe HMR broadcast and OTA bundle coordination for HmrHub.
impl HmrHub
Thread-safe HMR broadcast and OTA bundle coordination for HmrHub.
Sourcepub fn new(initial_ota: OtaBundleState) -> Self
pub fn new(initial_ota: OtaBundleState) -> Self
Sourcepub fn publish(
&self,
kind: HmrEventKind,
message: String,
changed_files: Vec<String>,
) -> u64
pub fn publish( &self, kind: HmrEventKind, message: String, changed_files: Vec<String>, ) -> u64
Increments the revision counter and publishes a new HmrEvent to all SSE subscribers.
§Arguments
&Self- Hub reference.HmrEventKind- Event variant (Reload,OtaUpdate, orBuildError).String- Human-readable event description.Vec<String>- List of changed source paths.
§Returns
u64- Newly assigned revision number.
Sourcepub fn set_ota_state(&self, next_state: OtaBundleState)
pub fn set_ota_state(&self, next_state: OtaBundleState)
Replaces the active signed Dynamic WASM OTA bundle served over HTTP.
§Arguments
&Self- Hub reference.OtaBundleState- Freshly compiled and signed OTA artifact.
Sourcepub fn current_event(&self) -> Option<HmrEvent>
pub fn current_event(&self) -> Option<HmrEvent>
Sourcepub fn ota_snapshot(&self) -> Option<OtaBundleState>
pub fn ota_snapshot(&self) -> Option<OtaBundleState>
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HmrHub
impl Forget for HmrHub
impl Move for HmrHub
impl RefUnwindSafe for HmrHub
impl Send for HmrHub
impl Sync for HmrHub
impl Unpin for HmrHub
impl UnsafeUnpin for HmrHub
impl UnwindSafe for HmrHub
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