pub struct ViewTransitionManager {
pub active_transitions: HashMap<String, ViewTransitionSnapshot>,
pub pending_old_snapshots: HashMap<String, Rect>,
}Expand description
Coordinates same-document view transitions, cross-fading and interpolating geometry between layout states.
Fields§
§active_transitions: HashMap<String, ViewTransitionSnapshot>§pending_old_snapshots: HashMap<String, Rect>Implementations§
Source§impl ViewTransitionManager
impl ViewTransitionManager
Sourcepub fn capture_old_state(&mut self, named_elements: &[(String, Rect)])
pub fn capture_old_state(&mut self, named_elements: &[(String, Rect)])
Captures the current bounding boxes of all named view-transition elements before a DOM mutation.
Sourcepub fn start_transition(
&mut self,
new_elements: &[(String, Rect)],
now_ms: f64,
duration_ms: f32,
)
pub fn start_transition( &mut self, new_elements: &[(String, Rect)], now_ms: f64, duration_ms: f32, )
Starts view transitions by pairing previously captured old bounds with newly computed layout rects.
Sourcepub fn step(&mut self, now_ms: f64) -> bool
pub fn step(&mut self, now_ms: f64) -> bool
Advances active view transitions at timestamp now_ms. Returns true if any transition remains active.
Sourcepub fn sample(&self, name: &str, now_ms: f64) -> Option<(Rect, f32)>
pub fn sample(&self, name: &str, now_ms: f64) -> Option<(Rect, f32)>
Samples current interpolated bounding rect and progress t in [0.0, 1.0] for a named transition.
Sourcepub fn has_active_transitions(&self) -> bool
pub fn has_active_transitions(&self) -> bool
Returns true if there are any active view transitions in progress.
Trait Implementations§
Source§impl Clone for ViewTransitionManager
impl Clone for ViewTransitionManager
Source§impl Debug for ViewTransitionManager
impl Debug for ViewTransitionManager
Auto Trait Implementations§
impl Forget for ViewTransitionManager
impl Freeze for ViewTransitionManager
impl Move for ViewTransitionManager
impl RefUnwindSafe for ViewTransitionManager
impl Send for ViewTransitionManager
impl Sync for ViewTransitionManager
impl Unpin for ViewTransitionManager
impl UnsafeUnpin for ViewTransitionManager
impl UnwindSafe for ViewTransitionManager
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