Struct webrender_traits::display_list::ScrollTreeNode
source · pub struct ScrollTreeNode {
pub parent: Option<ScrollTreeNodeId>,
pub scroll_info: Option<ScrollableNodeInfo>,
}
Expand description
A node in a tree of scroll nodes. This may either be a scrollable node which responds to scroll events or a non-scrollable one.
Fields§
§parent: Option<ScrollTreeNodeId>
The index of the parent of this node in the tree. If this is None then this is the root node.
scroll_info: Option<ScrollableNodeInfo>
Scrolling data which will not be None if this is a scrolling node.
Implementations§
source§impl ScrollTreeNode
impl ScrollTreeNode
sourcepub fn external_id(&self) -> Option<ExternalScrollId>
pub fn external_id(&self) -> Option<ExternalScrollId>
Get the external id of this node.
sourcepub fn offset(&self) -> Option<LayoutVector2D>
pub fn offset(&self) -> Option<LayoutVector2D>
Get the offset id of this node if it applies.
sourcepub fn set_offset(&mut self, new_offset: LayoutVector2D) -> bool
pub fn set_offset(&mut self, new_offset: LayoutVector2D) -> bool
Set the offset for this node, returns false if this was a non-scrolling node for which you cannot set the offset.
sourcepub fn scroll(
&mut self,
scroll_location: ScrollLocation,
) -> Option<(ExternalScrollId, LayoutVector2D)>
pub fn scroll( &mut self, scroll_location: ScrollLocation, ) -> Option<(ExternalScrollId, LayoutVector2D)>
Scroll this node given a WebRender ScrollLocation. Returns a tuple that can be used to scroll an individual WebRender scroll frame if the operation actually changed an offset.
Trait Implementations§
source§impl Debug for ScrollTreeNode
impl Debug for ScrollTreeNode
source§impl<'de> Deserialize<'de> for ScrollTreeNode
impl<'de> Deserialize<'de> for ScrollTreeNode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ScrollTreeNode
impl RefUnwindSafe for ScrollTreeNode
impl Send for ScrollTreeNode
impl Sync for ScrollTreeNode
impl Unpin for ScrollTreeNode
impl UnwindSafe for ScrollTreeNode
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert