pub struct HandoffCoordinator { /* private fields */ }Expand description
Frame-boundary backend handoff state machine ensuring uninterrupted presentation, exact version matching, and deferred resource release.
Implementations§
Source§impl HandoffCoordinator
Frame-boundary handoff lifecycle methods for HandoffCoordinator.
impl HandoffCoordinator
Frame-boundary handoff lifecycle methods for HandoffCoordinator.
Sourcepub fn last_abort_reason_value(&self) -> Option<HandoffAbortReason>
pub fn last_abort_reason_value(&self) -> Option<HandoffAbortReason>
Sourcepub fn is_in_flight(&self) -> bool
pub fn is_in_flight(&self) -> bool
Sourcepub fn begin_handoff(
&mut self,
old: RenderBackendCandidate,
target: RenderBackendCandidate,
frame_identity: (u32, u32, f32, u64),
now_ms: u64,
state: RuntimeStateSnapshot,
)
pub fn begin_handoff( &mut self, old: RenderBackendCandidate, target: RenderBackendCandidate, frame_identity: (u32, u32, f32, u64), now_ms: u64, state: RuntimeStateSnapshot, )
Starts warming up target on exact (width, height, scale_factor, scene_version) while old continues presenting uninterrupted.
§Arguments
&Self- Mutable handoff coordinator.RenderBackendCandidate- Currently presenting backend that remains active during warmup.RenderBackendCandidate- Candidate backend to warm up.(u32, u32, f32, u64)- Tuple(width, height, scale_factor, scene_version).u64- Monotonic start timestamp in milliseconds.RuntimeStateSnapshot- Interactive state snapshot that MUST remain invariant across takeover.
Sourcepub fn step_warmup(
&mut self,
step_elapsed_ms: f64,
step_ok: bool,
now_ms: u64,
) -> Result<HandoffStage, HandoffAbortReason>
pub fn step_warmup( &mut self, step_elapsed_ms: f64, step_ok: bool, now_ms: u64, ) -> Result<HandoffStage, HandoffAbortReason>
Executes one budget-sliced UI/render-thread warmup step, aborting cleanly if warmup times out or init fails.
§Arguments
&Self- Mutable handoff coordinator.f64- Elapsed work slice duration in milliseconds for this frame.bool-trueif this warmup step succeeded without error.u64- Current monotonic timestamp in milliseconds.
§Returns
Result<HandoffStage, HandoffAbortReason>- Updated handoff stage or clean abort reason.
Sourcepub fn try_commit_at_frame_boundary(
&mut self,
first_frame: HandoffFrameDescriptor,
current_frame: (u32, u32, f32, u64),
commit_fence_id: u64,
now_ms: u64,
) -> Result<RenderBackendCandidate, HandoffAbortReason>
pub fn try_commit_at_frame_boundary( &mut self, first_frame: HandoffFrameDescriptor, current_frame: (u32, u32, f32, u64), commit_fence_id: u64, now_ms: u64, ) -> Result<RenderBackendCandidate, HandoffAbortReason>
Attempts atomic takeover at a frame boundary ONLY when candidate first frame matches (width, height, scale_factor, scene_version) and meets deadline.
§Arguments
&Self- Mutable handoff coordinator.HandoffFrameDescriptor- Candidate’s verified first frame descriptor.(u32, u32, f32, u64)- Current live(width, height, scale_factor, scene_version)at the frame boundary.u64- Sync fence ID associated with the takeover frame.u64- Current monotonic timestamp in milliseconds.
§Returns
Result<RenderBackendCandidate, HandoffAbortReason>- New active candidate on boundary commit, or abort reason keeping old backend active.
Sourcepub fn confirm_post_handoff_present(
&mut self,
present_confirmed: bool,
completed_fence_id: u64,
) -> bool
pub fn confirm_post_handoff_present( &mut self, present_confirmed: bool, completed_fence_id: u64, ) -> bool
Confirms post-handoff presentation and sync fence completion, releasing old backend resources ONLY once both succeed.
§Arguments
&Self- Mutable handoff coordinator.bool-truewhen the post-handoff frame was confirmed presented on the new backend.u64- Highest completed GPU/surface sync fence identifier.
§Returns
bool-truewhen old backend resources are now safe to release and the handoff is finalized as a seamless success.
Sourcepub fn abort_for_fault(&mut self)
pub fn abort_for_fault(&mut self)
Aborts any in-flight handoff because of an external fault without crediting seamless_success_count.
§Arguments
&Self- Mutable handoff coordinator.
Source§impl HandoffCoordinator
impl HandoffCoordinator
pub fn get_stage(&self) -> HandoffStage
pub fn get_mut_stage(&mut self) -> &mut HandoffStage
pub fn set_stage(&mut self, val: HandoffStage) -> &mut Self
pub fn get_old_candidate(&self) -> RenderBackendCandidate
pub fn get_mut_old_candidate(&mut self) -> &mut RenderBackendCandidate
pub fn set_old_candidate(&mut self, val: RenderBackendCandidate) -> &mut Self
pub fn get_target_candidate(&self) -> RenderBackendCandidate
pub fn get_mut_target_candidate(&mut self) -> &mut RenderBackendCandidate
pub fn set_target_candidate(&mut self, val: RenderBackendCandidate) -> &mut Self
pub fn get_target_width(&self) -> u32
pub fn get_mut_target_width(&mut self) -> &mut u32
pub fn set_target_width(&mut self, val: u32) -> &mut Self
pub fn get_target_height(&self) -> u32
pub fn get_mut_target_height(&mut self) -> &mut u32
pub fn set_target_height(&mut self, val: u32) -> &mut Self
pub fn get_target_scale_factor(&self) -> f32
pub fn get_mut_target_scale_factor(&mut self) -> &mut f32
pub fn set_target_scale_factor(&mut self, val: f32) -> &mut Self
pub fn get_target_scene_version(&self) -> u64
pub fn get_mut_target_scene_version(&mut self) -> &mut u64
pub fn set_target_scene_version(&mut self, val: u64) -> &mut Self
pub fn get_started_at_ms(&self) -> u64
pub fn get_mut_started_at_ms(&mut self) -> &mut u64
pub fn set_started_at_ms(&mut self, val: u64) -> &mut Self
pub fn get_warmup_steps_completed(&self) -> u32
pub fn get_mut_warmup_steps_completed(&mut self) -> &mut u32
pub fn set_warmup_steps_completed(&mut self, val: u32) -> &mut Self
pub fn get_budget_config(&self) -> HandoffBudgetConfig
pub fn get_mut_budget_config(&mut self) -> &mut HandoffBudgetConfig
pub fn set_budget_config(&mut self, val: HandoffBudgetConfig) -> &mut Self
pub fn get_old_resources_retained(&self) -> bool
pub fn get_mut_old_resources_retained(&mut self) -> &mut bool
pub fn set_old_resources_retained(&mut self, val: bool) -> &mut Self
pub fn get_commit_fence_id(&self) -> u64
pub fn get_mut_commit_fence_id(&mut self) -> &mut u64
pub fn set_commit_fence_id(&mut self, val: u64) -> &mut Self
pub fn get_completed_fence_id(&self) -> u64
pub fn get_mut_completed_fence_id(&mut self) -> &mut u64
pub fn set_completed_fence_id(&mut self, val: u64) -> &mut Self
pub fn get_post_handoff_present_confirmed(&self) -> bool
pub fn get_mut_post_handoff_present_confirmed(&mut self) -> &mut bool
pub fn set_post_handoff_present_confirmed(&mut self, val: bool) -> &mut Self
pub fn get_mut_last_abort_reason(&mut self) -> &mut Option<HandoffAbortReason>
pub fn set_last_abort_reason( &mut self, val: Option<HandoffAbortReason>, ) -> &mut Self
pub fn get_seamless_success_count(&self) -> u64
pub fn get_mut_seamless_success_count(&mut self) -> &mut u64
pub fn set_seamless_success_count(&mut self, val: u64) -> &mut Self
pub fn get_abort_count(&self) -> u64
pub fn get_mut_abort_count(&mut self) -> &mut u64
pub fn set_abort_count(&mut self, val: u64) -> &mut Self
pub fn get_preserved_state(&self) -> RuntimeStateSnapshot
pub fn get_mut_preserved_state(&mut self) -> &mut RuntimeStateSnapshot
pub fn set_preserved_state(&mut self, val: RuntimeStateSnapshot) -> &mut Self
Trait Implementations§
Source§impl Clone for HandoffCoordinator
impl Clone for HandoffCoordinator
impl Copy for HandoffCoordinator
Source§impl Debug for HandoffCoordinator
impl Debug for HandoffCoordinator
Source§impl Default for HandoffCoordinator
Default idle state for HandoffCoordinator.
impl Default for HandoffCoordinator
Default idle state for HandoffCoordinator.