pub struct BuildBeforeSwapController { /* private fields */ }Expand description
Deterministic state machine tracking zero-flicker build-before-swap transitions for native targets.
Implementations§
Source§impl BuildBeforeSwapController
Zero-flicker build-before-swap coordination for native app hot restarts.
impl BuildBeforeSwapController
Zero-flicker build-before-swap coordination for native app hot restarts.
Sourcepub fn mark_initial_launched(&mut self)
pub fn mark_initial_launched(&mut self)
Records an initial launched process generation.
Sourcepub fn apply_rebuild<BuildFn, StopFn, SpawnFn>(
&mut self,
build_fn: BuildFn,
stop_old_fn: StopFn,
spawn_new_fn: SpawnFn,
) -> SwapOutcome
pub fn apply_rebuild<BuildFn, StopFn, SpawnFn>( &mut self, build_fn: BuildFn, stop_old_fn: StopFn, spawn_new_fn: SpawnFn, ) -> SwapOutcome
Compiles FIRST via build_fn; only invokes stop_old_fn and spawn_new_fn when compilation succeeds.
§Arguments
&Self- Swap controller state.BuildFn- Build step executed while the existing process remains running.StopFn- Shutdown hook terminating the previous running process.SpawnFn- Launch hook starting the newly compiled binary.
§Returns
SwapOutcome-Swapped/LaunchedInitialon success, orKeptRunningOnErrorwhen the old app stayed alive.
Source§impl BuildBeforeSwapController
impl BuildBeforeSwapController
pub fn get_active_generation(&self) -> u64
pub fn get_mut_active_generation(&mut self) -> &mut u64
pub fn set_active_generation(&mut self, val: u64) -> &mut Self
pub fn get_swap_count(&self) -> u64
pub fn get_mut_swap_count(&mut self) -> &mut u64
pub fn set_swap_count(&mut self, val: u64) -> &mut Self
pub fn get_kept_alive_on_error_count(&self) -> u64
pub fn get_mut_kept_alive_on_error_count(&mut self) -> &mut u64
pub fn set_kept_alive_on_error_count(&mut self, val: u64) -> &mut Self
pub fn get_last_error(&self) -> String
pub fn try_get_last_error(&self) -> &Option<String>
pub fn get_mut_last_error(&mut self) -> &mut Option<String>
pub fn set_last_error(&mut self, val: Option<String>) -> &mut Self
Trait Implementations§
Source§impl Clone for BuildBeforeSwapController
impl Clone for BuildBeforeSwapController
Source§impl Debug for BuildBeforeSwapController
impl Debug for BuildBeforeSwapController
Source§impl Default for BuildBeforeSwapController
impl Default for BuildBeforeSwapController
Source§impl<'de> Deserialize<'de> for BuildBeforeSwapController
impl<'de> Deserialize<'de> for BuildBeforeSwapController
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for BuildBeforeSwapController
impl StructuralPartialEq for BuildBeforeSwapController
Auto Trait Implementations§
impl Forget for BuildBeforeSwapController
impl Freeze for BuildBeforeSwapController
impl Move for BuildBeforeSwapController
impl RefUnwindSafe for BuildBeforeSwapController
impl Send for BuildBeforeSwapControllerwhere
RawVecInner: Send,
impl Sync for BuildBeforeSwapControllerwhere
RawVecInner: Sync,
impl Unpin for BuildBeforeSwapController
impl UnsafeUnpin for BuildBeforeSwapController
impl UnwindSafe for BuildBeforeSwapControllerwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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