Skip to main content

HandoffCoordinator

Struct HandoffCoordinator 

Source
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.

Source

pub fn last_abort_reason_value(&self) -> Option<HandoffAbortReason>

Returns the most recent abort reason, if any handoff aborted.

§Arguments
  • &Self - Coordinator reference.
§Returns
  • Option<HandoffAbortReason> - Last abort reason.
Source

pub fn is_in_flight(&self) -> bool

Returns true when a handoff is warming up, boundary-ready, or awaiting post-handoff present confirmation.

§Arguments
  • &Self - Coordinator reference.
§Returns
  • bool - true when in flight.
Source

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.
Source

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 - true if this warmup step succeeded without error.
  • u64 - Current monotonic timestamp in milliseconds.
§Returns
  • Result<HandoffStage, HandoffAbortReason> - Updated handoff stage or clean abort reason.
Source

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.
Source

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 - true when the post-handoff frame was confirmed presented on the new backend.
  • u64 - Highest completed GPU/surface sync fence identifier.
§Returns
  • bool - true when old backend resources are now safe to release and the handoff is finalized as a seamless success.
Source

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

Source

pub fn get_stage(&self) -> HandoffStage

Source

pub fn get_mut_stage(&mut self) -> &mut HandoffStage

Source

pub fn set_stage(&mut self, val: HandoffStage) -> &mut Self

Source

pub fn get_old_candidate(&self) -> RenderBackendCandidate

Source

pub fn get_mut_old_candidate(&mut self) -> &mut RenderBackendCandidate

Source

pub fn set_old_candidate(&mut self, val: RenderBackendCandidate) -> &mut Self

Source

pub fn get_target_candidate(&self) -> RenderBackendCandidate

Source

pub fn get_mut_target_candidate(&mut self) -> &mut RenderBackendCandidate

Source

pub fn set_target_candidate(&mut self, val: RenderBackendCandidate) -> &mut Self

Source

pub fn get_target_width(&self) -> u32

Source

pub fn get_mut_target_width(&mut self) -> &mut u32

Source

pub fn set_target_width(&mut self, val: u32) -> &mut Self

Source

pub fn get_target_height(&self) -> u32

Source

pub fn get_mut_target_height(&mut self) -> &mut u32

Source

pub fn set_target_height(&mut self, val: u32) -> &mut Self

Source

pub fn get_target_scale_factor(&self) -> f32

Source

pub fn get_mut_target_scale_factor(&mut self) -> &mut f32

Source

pub fn set_target_scale_factor(&mut self, val: f32) -> &mut Self

Source

pub fn get_target_scene_version(&self) -> u64

Source

pub fn get_mut_target_scene_version(&mut self) -> &mut u64

Source

pub fn set_target_scene_version(&mut self, val: u64) -> &mut Self

Source

pub fn get_started_at_ms(&self) -> u64

Source

pub fn get_mut_started_at_ms(&mut self) -> &mut u64

Source

pub fn set_started_at_ms(&mut self, val: u64) -> &mut Self

Source

pub fn get_warmup_steps_completed(&self) -> u32

Source

pub fn get_mut_warmup_steps_completed(&mut self) -> &mut u32

Source

pub fn set_warmup_steps_completed(&mut self, val: u32) -> &mut Self

Source

pub fn get_budget_config(&self) -> HandoffBudgetConfig

Source

pub fn get_mut_budget_config(&mut self) -> &mut HandoffBudgetConfig

Source

pub fn set_budget_config(&mut self, val: HandoffBudgetConfig) -> &mut Self

Source

pub fn get_old_resources_retained(&self) -> bool

Source

pub fn get_mut_old_resources_retained(&mut self) -> &mut bool

Source

pub fn set_old_resources_retained(&mut self, val: bool) -> &mut Self

Source

pub fn get_commit_fence_id(&self) -> u64

Source

pub fn get_mut_commit_fence_id(&mut self) -> &mut u64

Source

pub fn set_commit_fence_id(&mut self, val: u64) -> &mut Self

Source

pub fn get_completed_fence_id(&self) -> u64

Source

pub fn get_mut_completed_fence_id(&mut self) -> &mut u64

Source

pub fn set_completed_fence_id(&mut self, val: u64) -> &mut Self

Source

pub fn get_post_handoff_present_confirmed(&self) -> bool

Source

pub fn get_mut_post_handoff_present_confirmed(&mut self) -> &mut bool

Source

pub fn set_post_handoff_present_confirmed(&mut self, val: bool) -> &mut Self

Source

pub fn get_mut_last_abort_reason(&mut self) -> &mut Option<HandoffAbortReason>

Source

pub fn set_last_abort_reason( &mut self, val: Option<HandoffAbortReason>, ) -> &mut Self

Source

pub fn get_seamless_success_count(&self) -> u64

Source

pub fn get_mut_seamless_success_count(&mut self) -> &mut u64

Source

pub fn set_seamless_success_count(&mut self, val: u64) -> &mut Self

Source

pub fn get_abort_count(&self) -> u64

Source

pub fn get_mut_abort_count(&mut self) -> &mut u64

Source

pub fn set_abort_count(&mut self, val: u64) -> &mut Self

Source

pub fn get_preserved_state(&self) -> RuntimeStateSnapshot

Source

pub fn get_mut_preserved_state(&mut self) -> &mut RuntimeStateSnapshot

Source

pub fn set_preserved_state(&mut self, val: RuntimeStateSnapshot) -> &mut Self

Trait Implementations§

Source§

impl Clone for HandoffCoordinator

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for HandoffCoordinator

Source§

impl Debug for HandoffCoordinator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HandoffCoordinator

Default idle state for HandoffCoordinator.

Source§

fn default() -> Self

Creates an idle HandoffCoordinator.

§Returns
  • Self - Idle handoff coordinator.
Source§

impl PartialEq for HandoffCoordinator

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HandoffCoordinator

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.