pub struct ScrollMetrics {
pub viewport_h: f32,
pub content_h: f32,
pub max_offset: f32,
}Expand description
Layout snapshot for a scrollable node. Written each frame by
apply_scroll_offset; read by the scrollbar thumb in draw_ops
and by runtime’s thumb-drag plumbing. viewport_h is the
scrollable’s inner-rect height (post-padding); content_h is the
total height of its children; max_offset is (content_h - viewport_h).max(0.0).
Fields§
§viewport_h: f32§content_h: f32§max_offset: f32Trait Implementations§
Source§impl Clone for ScrollMetrics
impl Clone for ScrollMetrics
Source§fn clone(&self) -> ScrollMetrics
fn clone(&self) -> ScrollMetrics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScrollMetrics
impl Debug for ScrollMetrics
Source§impl Default for ScrollMetrics
impl Default for ScrollMetrics
Source§fn default() -> ScrollMetrics
fn default() -> ScrollMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for ScrollMetrics
impl PartialEq for ScrollMetrics
Source§fn eq(&self, other: &ScrollMetrics) -> bool
fn eq(&self, other: &ScrollMetrics) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ScrollMetrics
impl StructuralPartialEq for ScrollMetrics
Auto Trait Implementations§
impl Freeze for ScrollMetrics
impl RefUnwindSafe for ScrollMetrics
impl Send for ScrollMetrics
impl Sync for ScrollMetrics
impl Unpin for ScrollMetrics
impl UnsafeUnpin for ScrollMetrics
impl UnwindSafe for ScrollMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.