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 HmrHubwhere
Atomic<u64>: RefUnwindSafe,
Mutex<Option<HmrEvent>>: RefUnwindSafe,
Mutex<OtaBundleState>: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
impl Send for HmrHub
impl Sync for HmrHub
impl Unpin for HmrHub
impl UnsafeUnpin for HmrHubwhere
Align8<u64>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for HmrHubwhere
Align8<u64>: UnwindSafe,
Mutex<Option<HmrEvent>>: UnwindSafe,
Mutex<OtaBundleState>: UnwindSafe,
Align1<u8>: UnwindSafe,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more