Skip to main content

Layer

Struct Layer 

Source
pub struct Layer {
    pub origin: Origin,
    pub kind: LayerKind,
    pub rect: Rect,
    /* private fields */
}
Expand description

One document placed in the window.

Fields§

§origin: Origin

The document’s trust context.

§kind: LayerKind

The layer’s role.

§rect: Rect

Where the document sits in the window (computed from the parent for sub-documents, fixed otherwise).

Implementations§

Source§

impl Layer

Source

pub fn engine(&self) -> &Engine

The document.

Source

pub fn engine_mut(&mut self) -> &mut Engine

The document, to change in place. The change shows after the next Host::layout.

Source

pub fn styles(&self) -> &Styles

The computed styles (populated by Host::layout).

Source

pub fn layout(&self) -> &LayoutTree

The box tree (populated by Host::layout).

Source

pub fn commands(&self) -> &CommandList

The layer’s paint commands (populated by Host::layout).

Source

pub fn anchor(&self) -> Option<Anchor>

The sub-document anchor, if this layer is a sub-document.

Source

pub fn scroll(&self) -> Point

The layer’s current scroll offset.

Source

pub fn set_scroll_y(&mut self, y: f32)

Set the layer’s vertical scroll offset, clamped to 0.0..=max_scroll_y().

Source

pub fn max_scroll_y(&self) -> f32

The maximum vertical scroll for this layer (content height minus the viewport height, floored at zero).

Source

pub fn a11y(&self, focus: Option<NodeId>) -> A11yTree

This layer’s accessibility tree, with bounds in the layer’s own coordinates and focus marked on the source node.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Layer

§

impl !UnwindSafe for Layer

§

impl Forget for Layer

§

impl Freeze for Layer

§

impl Move for Layer

§

impl Send for Layer
where RawVecInner: Send, BoxRaw<SelectorList>: Send, RawTable<(String, Vec<usize>)>: Send, BoxRaw<dyn Loader + Sync + Send>: Send, Arc<Shared>: Send, RawTable<(String, ())>: Send, RawTable<(RequestId, String)>: Send, RawTable<(String, Image)>: Send, BoxRaw<[CalcTerm]>: Send, Arc<HashMap<String, Vec<Value>>>: Send, RawTable<(NodeId, usize)>: Send, RawTable<(NodeId, NodeId)>: Send, RawTable<(NodeId, EncodedImage)>: Send, RawTable<(NodeId, Vec<BorderSegment>)>: Send, Arc<[u8]>: Send,

§

impl Sync for Layer
where RawVecInner: Sync, BoxRaw<SelectorList>: Sync, RawTable<(String, Vec<usize>)>: Sync, BoxRaw<dyn Loader + Sync + Send>: Sync, Arc<Shared>: Sync, RawTable<(String, ())>: Sync, RawTable<(RequestId, String)>: Sync, RawTable<(String, Image)>: Sync, BoxRaw<[CalcTerm]>: Sync, Arc<HashMap<String, Vec<Value>>>: Sync, RawTable<(NodeId, usize)>: Sync, RawTable<(NodeId, NodeId)>: Sync, RawTable<(NodeId, EncodedImage)>: Sync, RawTable<(NodeId, Vec<BorderSegment>)>: Sync, Arc<[u8]>: Sync,

§

impl Unpin for Layer
where *const u8 is !null: Unpin, Box<SelectorList>: Unpin, Box<dyn Loader + Sync + Send>: Unpin, Arc<Shared>: Unpin, Arc<[u8]>: Unpin, Box<[CalcTerm]>: Unpin, Arc<HashMap<String, Vec<Value>>>: Unpin,

§

impl UnsafeUnpin for Layer

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> 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, 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.