Skip to main content

ScrollOffsets

Struct ScrollOffsets 

Source
pub struct ScrollOffsets { /* private fields */ }
Expand description

Per-surface scroll offset map plus generation-safe dense requested_scroll_seq deduplication and reusable Layer-1 scroll anchor / scratch buffers (0-alloc steady state).

Implementations§

Source§

impl ScrollOffsets

Source

pub fn get(&self, id: NodeId) -> (f32, f32)

Source

pub fn iter(&self) -> impl Iterator<Item = (NodeId, (f32, f32))> + '_

Every tracked (node, (x, y)) offset, in unspecified order.

Source

pub fn contains(&self, id: NodeId) -> bool

Source

pub fn last_requested_seq(&self, id: NodeId) -> u32

Source

pub fn last_changed(&self) -> &[NodeId]

Nodes whose effective scroll offset changed during the most recent reconciliation pass.

Source

pub fn set_raw(&mut self, id: NodeId, x: f32, y: f32)

Source

pub fn remove(&mut self, id: NodeId)

Source

pub fn clear(&mut self)

Source

pub fn visual_shift(&self, store: &NodeStore, id: NodeId) -> (f32, f32)

Clamped visual child shift for id, subtracting any virtualized Scroll::virtual_top_spacer. Pure clamped (zero synthetic overscroll) so OS-native scroll hosts never receive rubber-band offsets through NvScrollOffset.

Source

pub fn visual_shift_with( store: &NodeStore, id: NodeId, sx: f32, sy: f32, ) -> (f32, f32)

Self::visual_shift for an offset (sx, sy) already read (e.g. from Self::iter).

Trait Implementations§

Source§

impl Clone for ScrollOffsets

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 Debug for ScrollOffsets

Source§

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

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

impl Default for ScrollOffsets

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for ScrollOffsets

§

impl Freeze for ScrollOffsets
where *const u8 is !null: Freeze, PhantomData<(NodeId, (f32, f32))>: Freeze, PhantomData<SeqSlot>: Freeze, PhantomData<ScrollReconcileEntry>: Freeze, PhantomData<NodeId>: Freeze, PhantomData<CapturedScrollAnchor>: Freeze,

§

impl Move for ScrollOffsets

§

impl RefUnwindSafe for ScrollOffsets

§

impl Send for ScrollOffsets
where RawTable<(NodeId, (f32, f32))>: Send, RawVecInner: Send,

§

impl Sync for ScrollOffsets
where RawTable<(NodeId, (f32, f32))>: Sync, RawVecInner: Sync,

§

impl Unpin for ScrollOffsets
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for ScrollOffsets
where *const u8 is !null: UnsafeUnpin, PhantomData<(NodeId, (f32, f32))>: UnsafeUnpin, PhantomData<SeqSlot>: UnsafeUnpin, PhantomData<ScrollReconcileEntry>: UnsafeUnpin, PhantomData<NodeId>: UnsafeUnpin, PhantomData<CapturedScrollAnchor>: UnsafeUnpin,

§

impl UnwindSafe for ScrollOffsets
where HashMap<NodeId, (f32, f32)>: UnwindSafe, RawVecInner: UnwindSafe,

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.