Skip to main content

FrameSession

Struct FrameSession 

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

A window’s layout engine session.

Implementations§

Source§

impl FrameSession

Source

pub fn new(layout_engine: Box<dyn LayoutEngine>) -> Self

Creates a session that drives layout_engine.

Source

pub fn clear(&self)

Discards the layout tree and cached bounds, ready for a new frame.

Source

pub fn request_layout( &self, style: &EngineLayoutStyle, rem_size: Pixels, scale_factor: f32, children: &[LayoutId], ) -> LayoutId

Adds a node built from style.

Source

pub fn request_measured_layout( &self, style: &EngineLayoutStyle, rem_size: Pixels, scale_factor: f32, measure: BoxedMeasureFn, ) -> LayoutId

Adds a leaf whose size is resolved by measure during layout.

Source

pub fn stretch_auto_size_to_fill( &self, id: LayoutId, size: Size<Pixels>, scale_factor: f32, )

Treats any auto dimension of id’s style as filling size.

Source

pub fn compute_layout( &self, id: LayoutId, available_space: Size<AvailableSpace>, scale_factor: f32, context: &mut dyn MeasureContext, )

Computes the layout of id within available_space.

Source

pub fn layout_bounds(&self, id: LayoutId, scale_factor: f32) -> Bounds<Pixels>

Returns the pixel-snapped bounds of id relative to the window.

Auto Trait Implementations§

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.