pub struct Layer<'a> { /* private fields */ }Expand description
Information about a compositing layer.
Implementations§
Source§impl<'a> Layer<'a>
impl<'a> Layer<'a>
Sourcepub fn builder(
layer_id: impl Into<LayerId<'a>>,
offset_x: f64,
offset_y: f64,
width: f64,
height: f64,
paint_count: u64,
draws_content: bool,
) -> LayerBuilder<'a>
pub fn builder( layer_id: impl Into<LayerId<'a>>, offset_x: f64, offset_y: f64, width: f64, height: f64, paint_count: u64, draws_content: bool, ) -> LayerBuilder<'a>
Creates a builder for this type with the required parameters:
layer_id: The unique id for this layer.offset_x: Offset from parent layer, X coordinate.offset_y: Offset from parent layer, Y coordinate.width: Layer width.height: Layer height.paint_count: Indicates how many time this layer has painted.draws_content: Indicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only.
Sourcepub fn parent_layer_id(&self) -> Option<&LayerId<'a>>
pub fn parent_layer_id(&self) -> Option<&LayerId<'a>>
The id of parent (not present for root).
Sourcepub fn backend_node_id(&self) -> Option<&BackendNodeId>
pub fn backend_node_id(&self) -> Option<&BackendNodeId>
The backend id for the node associated with this layer.
Sourcepub fn transform(&self) -> Option<&[f64]>
pub fn transform(&self) -> Option<&[f64]>
Transformation matrix for layer, default is identity matrix
Sourcepub fn anchor_x(&self) -> Option<f64>
pub fn anchor_x(&self) -> Option<f64>
Transform anchor point X, absent if no transform specified
Sourcepub fn anchor_y(&self) -> Option<f64>
pub fn anchor_y(&self) -> Option<f64>
Transform anchor point Y, absent if no transform specified
Sourcepub fn anchor_z(&self) -> Option<f64>
pub fn anchor_z(&self) -> Option<f64>
Transform anchor point Z, absent if no transform specified
Sourcepub fn paint_count(&self) -> u64
pub fn paint_count(&self) -> u64
Indicates how many time this layer has painted.
Sourcepub fn draws_content(&self) -> bool
pub fn draws_content(&self) -> bool
Indicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only.
Sourcepub fn scroll_rects(&self) -> Option<&[ScrollRect<'a>]>
pub fn scroll_rects(&self) -> Option<&[ScrollRect<'a>]>
Rectangles scrolling on main thread only.
Sourcepub fn sticky_position_constraint(
&self,
) -> Option<&StickyPositionConstraint<'a>>
pub fn sticky_position_constraint( &self, ) -> Option<&StickyPositionConstraint<'a>>
Sticky position constraint information
Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Layer<'a>
impl<'de, 'a> Deserialize<'de> for Layer<'a>
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<'a> Freeze for Layer<'a>
impl<'a> RefUnwindSafe for Layer<'a>
impl<'a> Send for Layer<'a>
impl<'a> Sync for Layer<'a>
impl<'a> Unpin for Layer<'a>
impl<'a> UnsafeUnpin for Layer<'a>
impl<'a> UnwindSafe for Layer<'a>
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